import java.util.*;
public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	} main {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.nextLine(); s sc.nextLine() sc.nextLine sc int count=0; count 0 int tmp=0; tmp 0 String ATCG[]={"A","C","G","T"}; ATCG {"A","C","G","T"} "A" "C" "G" "T" for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        } String atcg ATCG {
          s=s.replace(atcg,"0");
        } {
          s=s.replace(atcg,"0");
        } s=s.replace(atcg,"0") s s.replace(atcg,"0") s.replace s atcg "0" for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        } {
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        } if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         } s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' {
           tmp+=1;
         } tmp+=1 tmp 1 {
           count=Math.max(tmp,count);
           tmp=0;
         } count=Math.max(tmp,count) count Math.max(tmp,count) Math.max Math tmp count tmp=0 tmp 0 count=Math.max(tmp,count) count Math.max(tmp,count) Math.max Math tmp count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	}
} Main
import java.util.*;
public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.nextLine();
      	int count=0;int tmp=0;
      	String ATCG[]={"A","C","G","T"};
      	for( String atcg:ATCG){
          s=s.replace(atcg,"0");
        }
      	for(int i=0;i<s.length();i++){
         if(s.charAt(i)=='0'){
           tmp+=1;
         }else{
           count=Math.max(tmp,count);
           tmp=0;
         }
        }
        count=Math.max(tmp,count);
		System.out.println(count);
		
		
	}
}
