import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int cnt = 0; cnt 0 int max = 0; max 0 for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		} {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		} if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			} s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' s[i] == 'C' s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' s[i] == 'A' s[i] s i 'A' s[i] == 'T' s[i] s i 'T' s[i] == 'C' s[i] s i 'C' s[i] == 'G' s[i] s i 'G' {
				cnt++;
				max = Math.max(max, cnt);
			} cnt++ cnt max = Math.max(max, cnt) max Math.max(max, cnt) Math.max Math max cnt {
				cnt = 0;
			} cnt = 0 cnt 0 System.out.println(max) System.out.println System.out System System.out max String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
				cnt++;
				max = Math.max(max, cnt);
			} else {
				cnt = 0;
			}
		}
		System.out.println(max);
	}
}