import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	}
} 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();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int answer = 0; answer 0 int maxAnswer = 0; maxAnswer 0 S = S.replace('A', '@') S S.replace('A', '@') S.replace S 'A' '@' S = S.replace('C', '@') S S.replace('C', '@') S.replace S 'C' '@' S = S.replace('G', '@') S S.replace('G', '@') S.replace S 'G' '@' S = S.replace('T', '@') S S.replace('T', '@') S.replace S 'T' '@' for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i ++ i ++ i {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		} {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		} String target = String.valueOf(S.toCharArray()[i]); target String.valueOf(S.toCharArray()[i]) String.valueOf String S.toCharArray()[i] S.toCharArray() S.toCharArray S i if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			} target.equals("@") target.equals target "@" {
				answer++;
			} answer++ answer {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			} maxAnswer = Math.max(maxAnswer, answer) maxAnswer Math.max(maxAnswer, answer) Math.max Math maxAnswer answer answer = 0 answer 0 maxAnswer = Math.max(maxAnswer, answer) maxAnswer Math.max(maxAnswer, answer) Math.max Math maxAnswer answer System.out.println(maxAnswer) System.out.println System.out System System.out maxAnswer String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int answer = 0;
		int maxAnswer = 0;

		S = S.replace('A', '@');
		S = S.replace('C', '@');
		S = S.replace('G', '@');
		S = S.replace('T', '@');

		for (int i = 0; i < S.length(); i ++) {
			String target = String.valueOf(S.toCharArray()[i]);
			if (target.equals("@")) {
				answer++;
			} else {
				maxAnswer = Math.max(maxAnswer, answer);
				answer = 0;
			}
		}
		maxAnswer = Math.max(maxAnswer, answer);
		System.out.println(maxAnswer);
	}
}
