import java.util.*;
public class Main {

	/*
	 * 122B - 3rd Solution
	 * 
	 * We will loop through the right end point of the possible substring
	 * We will also store (lst) which is the last index where it is not a ACGT character
	 * If the right endpoint is not an AGCT character update lst
	 * We know that [lst+1, i] is a possible substring so update answer
	 * 
	 * Time Complexity O(N), Memory Complexity O(N)
	 * 
	 */
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {

	/*
	 * 122B - 3rd Solution
	 * 
	 * We will loop through the right end point of the possible substring
	 * We will also store (lst) which is the last index where it is not a ACGT character
	 * If the right endpoint is not an AGCT character update lst
	 * We know that [lst+1, i] is a possible substring so update answer
	 * 
	 * Time Complexity O(N), Memory Complexity O(N)
	 * 
	 */
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		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 int N = s.length(); N s.length() s.length s int ans = 0 ans 0 lst = -1; lst -1 1 for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		} {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		} if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			} s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T' s.charAt(i) != 'G' s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T' s.charAt(i) != 'A' s.charAt(i) s.charAt s i 'A' s.charAt(i) != 'C' s.charAt(i) s.charAt s i 'C' s.charAt(i) != 'G' s.charAt(i) s.charAt s i 'G' s.charAt(i) != 'T' s.charAt(i) s.charAt s i 'T' {
				lst = i;
			} lst = i lst i ans = Math.max(ans, i-lst) ans Math.max(ans, i-lst) Math.max Math ans i-lst i lst System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	/*
	 * 122B - 3rd Solution
	 * 
	 * We will loop through the right end point of the possible substring
	 * We will also store (lst) which is the last index where it is not a ACGT character
	 * If the right endpoint is not an AGCT character update lst
	 * We know that [lst+1, i] is a possible substring so update answer
	 * 
	 * Time Complexity O(N), Memory Complexity O(N)
	 * 
	 */
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		System.out.println(ans);
	}
} public class Main {

	/*
	 * 122B - 3rd Solution
	 * 
	 * We will loop through the right end point of the possible substring
	 * We will also store (lst) which is the last index where it is not a ACGT character
	 * If the right endpoint is not an AGCT character update lst
	 * We know that [lst+1, i] is a possible substring so update answer
	 * 
	 * Time Complexity O(N), Memory Complexity O(N)
	 * 
	 */
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {

	/*
	 * 122B - 3rd Solution
	 * 
	 * We will loop through the right end point of the possible substring
	 * We will also store (lst) which is the last index where it is not a ACGT character
	 * If the right endpoint is not an AGCT character update lst
	 * We know that [lst+1, i] is a possible substring so update answer
	 * 
	 * Time Complexity O(N), Memory Complexity O(N)
	 * 
	 */
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0, lst = -1;
		for(int i = 0; i<N; i++) {
			if(s.charAt(i) != 'A' && s.charAt(i) != 'C' && s.charAt(i) != 'G' && s.charAt(i) != 'T') {
				lst = i;
			}
			ans = Math.max(ans, i-lst);
		}
		System.out.println(ans);
	}
}
