import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	}

} 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.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc sc.close() sc.close sc int maxLength = 0; maxLength 0 int counter = 0; counter 0 for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		} 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) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		} {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		} if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			} s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G' s.charAt(i) == 'T' s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G' 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) == 'T' s.charAt(i) s.charAt s i 'T' s.charAt(i) == 'G' s.charAt(i) s.charAt s i 'G' {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} counter++ counter maxLength=Math.max(maxLength, counter) maxLength Math.max(maxLength, counter) Math.max Math maxLength counter {
				counter = 0;
			} counter = 0 counter 0 System.out.println(maxLength) System.out.println System.out System System.out maxLength String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		int maxLength = 0;
		int counter = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'T' || s.charAt(i) == 'G') {
				counter++;
				maxLength=Math.max(maxLength, counter);
			} else {
				counter = 0;
			}
		}

		System.out.println(maxLength);

	}

}
