import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		String x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	}
} 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 x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		String x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		String x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String x = ""; x "" int num1 = 0; num1 0 int num2 = 0; num2 0 for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		} {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		} if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			} (S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C') (S.charAt(i) == 'G') (S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C') (S.charAt(i) == 'A') S.charAt(i) S.charAt S i 'A' (S.charAt(i) == 'T') S.charAt(i) S.charAt S i 'T' (S.charAt(i) == 'G') S.charAt(i) S.charAt S i 'G' (S.charAt(i) == 'C') S.charAt(i) S.charAt S i 'C' {
				x += "a";
			} x += "a" x "a" {
				x += "b";
			} x += "b" x "b" for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		} {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		} if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			} x.charAt(i) == 'a' x.charAt(i) x.charAt x i 'a' {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} num1++ num1 if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				} i == (S.length() - 1) i (S.length() - 1) S.length() S.length S 1 {
					if(num2 < num1) {
						num2 = num1;
					}
				} if(num2 < num1) {
						num2 = num1;
					} num2 < num1 num2 num1 {
						num2 = num1;
					} num2 = num1 num2 num1 {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			} if(num2 < num1) {
					num2 = num1;
				} num2 < num1 num2 num1 {
					num2 = num1;
				} num2 = num1 num2 num1 num1 = 0 num1 0 System.out.println(num2) System.out.println System.out System System.out num2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		String x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		String x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	}
} 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 x = "";
		int num1 = 0;
		int num2 = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if((S.charAt(i) == 'A') || (S.charAt(i) == 'T') || (S.charAt(i) == 'G') || (S.charAt(i) == 'C')) {
				x += "a";
			} else {
				x += "b";
			}
		}
		
		for(int i = 0; i < S.length(); i++) {
			if(x.charAt(i) == 'a') {
				num1++;
				if(i == (S.length() - 1)) {
					if(num2 < num1) {
						num2 = num1;
					}
				}
			} else {
				if(num2 < num1) {
					num2 = num1;
				}
				num1 = 0;
			}
		}
		
		System.out.println(num2);
		
	}
}
