import java.util.*;
public class Main {

	/*
	 * 122B - 1st Solution
	 * 
	 * Idea is to try all substrings of string s
	 * Every substring is defined from character i to character j
	 * To check if a substring is AGCT is by keeping a boolean good and check whether or not any character has it
	 * If it's good then update the answer if the length of the substring is bigger
	 * The length of the substring is j - i + 1 (+1 because we include the i-th character
	 * 
	 * Time Complexity O(N^3), 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;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {

	/*
	 * 122B - 1st Solution
	 * 
	 * Idea is to try all substrings of string s
	 * Every substring is defined from character i to character j
	 * To check if a substring is AGCT is by keeping a boolean good and check whether or not any character has it
	 * If it's good then update the answer if the length of the substring is bigger
	 * The length of the substring is j - i + 1 (+1 because we include the i-th character
	 * 
	 * Time Complexity O(N^3), 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;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		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;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		int ans = 0;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		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 for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		} {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		} for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			} int j = i; int j = i; j i j<N j N j++ j++ j {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			} {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			} boolean good = true; good true for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				} int k = i; int k = i; k i k<=j k j k++ k++ k {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				} {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				} if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					} s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T' s.charAt(k) != 'C' s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T' s.charAt(k) != 'A' s.charAt(k) s.charAt s k 'A' s.charAt(k) != 'G' s.charAt(k) s.charAt s k 'G' s.charAt(k) != 'C' s.charAt(k) s.charAt s k 'C' s.charAt(k) != 'T' s.charAt(k) s.charAt s k 'T' {
						good = false;
					} good = false good false if(good) {
					ans = Math.max(ans, j - i + 1);
				} good {
					ans = Math.max(ans, j - i + 1);
				} ans = Math.max(ans, j - i + 1) ans Math.max(ans, j - i + 1) Math.max Math ans j - i + 1 j - i j i 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	/*
	 * 122B - 1st Solution
	 * 
	 * Idea is to try all substrings of string s
	 * Every substring is defined from character i to character j
	 * To check if a substring is AGCT is by keeping a boolean good and check whether or not any character has it
	 * If it's good then update the answer if the length of the substring is bigger
	 * The length of the substring is j - i + 1 (+1 because we include the i-th character
	 * 
	 * Time Complexity O(N^3), 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;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		System.out.println(ans);
	}
} public class Main {

	/*
	 * 122B - 1st Solution
	 * 
	 * Idea is to try all substrings of string s
	 * Every substring is defined from character i to character j
	 * To check if a substring is AGCT is by keeping a boolean good and check whether or not any character has it
	 * If it's good then update the answer if the length of the substring is bigger
	 * The length of the substring is j - i + 1 (+1 because we include the i-th character
	 * 
	 * Time Complexity O(N^3), 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;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {

	/*
	 * 122B - 1st Solution
	 * 
	 * Idea is to try all substrings of string s
	 * Every substring is defined from character i to character j
	 * To check if a substring is AGCT is by keeping a boolean good and check whether or not any character has it
	 * If it's good then update the answer if the length of the substring is bigger
	 * The length of the substring is j - i + 1 (+1 because we include the i-th character
	 * 
	 * Time Complexity O(N^3), 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;
		for(int i = 0; i<N; i++) {
			for(int j = i; j<N; j++) {
				boolean good = true;
				for(int k = i; k<=j; k++) {
					if(s.charAt(k) != 'A' && s.charAt(k) != 'G' && s.charAt(k) != 'C' && s.charAt(k) != 'T') {
						good = false;
					}
				}
				if(good) {
					ans = Math.max(ans, j - i + 1);
				}
			}
		}
		System.out.println(ans);
	}
}
