import java.util.Scanner;


public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		}


} import java.util.Scanner; Scanner java.util public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		}


} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		} main {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int count = 0; count 0 int res = 0; res 0 for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		} int i =0; int i =0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		} {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		} char c = S.charAt(i); c S.charAt(i) S.charAt S i if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			} c=='A'||c=='G'||c=='C'||c=='T' c=='C' c=='A'||c=='G'||c=='C'||c=='T' c=='A' c 'A' c=='G' c 'G' c=='C' c 'C' c=='T' c 'T' {
				count++;
			} count++ count {
				res = Math.max(res, count);
				count=0;
			} res = Math.max(res, count) res Math.max(res, count) Math.max Math res count count=0 count 0 res = Math.max(res, count) res Math.max(res, count) Math.max Math res count System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		}


} public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		}


} Main
import java.util.Scanner;


public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		
		int count = 0;
		int res = 0;
		
		for(int i =0;i<S.length();i++) {
			char c = S.charAt(i);
			if(c=='A'||c=='G'||c=='C'||c=='T') {
				count++;
			}else {
				res = Math.max(res, count);
				count=0;
			}
		}
		
		res = Math.max(res, count);
		System.out.println(res);


		}


}