import java.util.*;

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

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