import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	}
} import java.util.*; util.* java public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) String S  = keyboard.next(); S keyboard.next() keyboard.next keyboard S = S.replace('A', '#') S S.replace('A', '#') S.replace S 'A' '#' S = S.replace('T', '#') S S.replace('T', '#') S.replace S 'T' '#' S = S.replace('G', '#') S S.replace('G', '#') S.replace S 'G' '#' S = S.replace('C', '#') S S.replace('C', '#') S.replace S 'C' '#' S = S + "?" S S + "?" S "?" String[] Y = S.split(""); Y S.split("") S.split S "" int count = 0; count 0 int ans = 0; ans 0 for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			} int i = 0; int i = 0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			} {
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			} if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					} Y[i].equals("#") Y[i].equals Y[i] Y i "#" {
				count++;
			} count++ count {
				ans = (count > ans) ? count : ans;
				count = 0;
					} ans = (count > ans) ? count : ans ans (count > ans) ? count : ans (count > ans) count ans count ans count = 0 count 0 System.out.println(ans) System.out.println System.out System System.out ans keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	}
} Main
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S  = keyboard.next();
		
		S = S.replace('A', '#');
		S = S.replace('T', '#');
		S = S.replace('G', '#');
		S = S.replace('C', '#');
		S = S + "?"; 
		String[] Y = S.split("");
		
		int count = 0;
		int ans = 0;
		
		for(int i = 0; i<S.length(); i++){
			if(Y[i].equals("#")){
				count++;
			}else{
				ans = (count > ans) ? count : ans;
				count = 0;
					}
			}

		System.out.println(ans);
		keyboard.close();	
	}
}