import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String s [] = S.split(""); s S.split("") S.split S "" int l = S.length(); l S.length() S.length S int i=0; i 0 int ans = 0; ans 0 while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		} i<l i l {
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		} int cnt = 0; cnt 0 if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			} s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true s[i].equals("C")!=true s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true s[i].equals("A")!=true s[i].equals("A") s[i].equals s[i] s i "A" true s[i].equals("T")!=true s[i].equals("T") s[i].equals s[i] s i "T" true s[i].equals("C")!=true s[i].equals("C") s[i].equals s[i] s i "C" true s[i].equals("G")!=true s[i].equals("G") s[i].equals s[i] s i "G" true {
				i++;
			} i++ i {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			} cnt++ cnt i++ i while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				} i<l i l {
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				} if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break; s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true s[i].equals("C")==true s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true s[i].equals("A")==true s[i].equals("A") s[i].equals s[i] s i "A" true s[i].equals("T")==true s[i].equals("T") s[i].equals s[i] s i "T" true s[i].equals("C")==true s[i].equals("C") s[i].equals s[i] s i "C" true s[i].equals("G")==true s[i].equals("G") s[i].equals s[i] s i "G" true {
						i++;
						cnt++;
					} i++ i cnt++ cnt break; ans = Math.max(ans,cnt) ans Math.max(ans,cnt) Math.max Math ans cnt System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String s [] = S.split("");
		//System.out.println(s[0].equals("A"));
		
		int l = S.length();
		
		int i=0;
		int ans = 0;
		while (i<l){
			int cnt = 0;
			if (s[i].equals("A")!=true && s[i].equals("T")!=true && s[i].equals("C")!=true && s[i].equals("G")!=true){
				i++;
			}
			
			else {
				cnt++;
				i++;
				
				while (i<l){
					if (s[i].equals("A")==true || s[i].equals("T")==true || s[i].equals("C")==true || s[i].equals("G")==true){
						i++;
						cnt++;
					}
					else
						break;
						
				}
			}
			ans = Math.max(ans,cnt);
			
		}
		System.out.println(ans);

	}

}
