import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
}
	 import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
} Main static int a1[]= {0,-1,0,1}; a1 {0,-1,0,1} 0 -1 1 0 1 static int b1[]= {-1,0,1,0}; b1 {-1,0,1,0} -1 1 0 1 0 private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) //Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	} main {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	} String S=sc.next(); S sc.next() sc.next sc int ctn=0; ctn 0 int ans=0; ans 0 for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		} {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		} if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			} S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84 S.charAt(i)==71 S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84 S.charAt(i)==65 S.charAt(i) S.charAt S i 65 S.charAt(i)==67 S.charAt(i) S.charAt S i 67 S.charAt(i)==71 S.charAt(i) S.charAt S i 71 S.charAt(i)==84 S.charAt(i) S.charAt S i 84 {
				ctn++;
			} ctn++ ctn {
				ctn=0;
			} ctn=0 ctn 0 ans=Math.max(ans, ctn) ans Math.max(ans, ctn) Math.max Math ans ctn p(ans) p ans String[] args args static void p(String ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans String ans ans static void p(int ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans int ans ans static void p() {System.out.println();} p {System.out.println();} System.out.println() System.out.println System.out System System.out static void p(long ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans long ans ans static void p(double ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans double ans ans public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
} public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		String S=sc.next();//65 //67 //71//84
		int ctn=0;
		int ans=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==65||S.charAt(i)==67||S.charAt(i)==71||S.charAt(i)==84) {
				ctn++;
			}else {
				ctn=0;
			}
			ans=Math.max(ans, ctn);
		}
		p(ans);
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
}
	