import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	}
		

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	} try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		} {
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan char[] s = new char[S.length()]; s new char[S.length()] S.length() S.length S s = S.toCharArray() s S.toCharArray() S.toCharArray S int maxcount = 0; maxcount 0 int nowcount = 0; nowcount 0 for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			} int i =0; int i =0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			} {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			} if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				} s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T' s[i]=='G' s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T' s[i]=='A' s[i] s i 'A' s[i]=='C' s[i] s i 'C' s[i]=='G' s[i] s i 'G' s[i]=='T' s[i] s i 'T' {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				} nowcount++ nowcount if(maxcount<nowcount) 
							maxcount =nowcount; maxcount<nowcount maxcount nowcount maxcount =nowcount maxcount nowcount {
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				} if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					} nowcount>0&&maxcount<nowcount nowcount>0 nowcount 0 maxcount<nowcount maxcount nowcount {
						maxcount = nowcount;
						nowcount =0;
					} maxcount = nowcount maxcount nowcount nowcount =0 nowcount 0 {
						nowcount = 0;
					} nowcount = 0 nowcount 0 System.out.println(maxcount) System.out.println System.out System System.out maxcount String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	}
		

} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	}
		

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			
			char[] s = new char[S.length()];
			s = S.toCharArray();
			
			int maxcount = 0;
			int nowcount = 0;
			
			for(int i =0;i<S.length();i++) {
				if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') {
						nowcount++;
						if(maxcount<nowcount) 
							maxcount =nowcount;
				}else{
					if(nowcount>0&&maxcount<nowcount) {
						maxcount = nowcount;
						nowcount =0;
					}else {
						nowcount = 0;
					}
					
					
				}
				
			}
		
			
			
			System.out.println(maxcount);
			
			
			
			
			
			
		}
		
	}
		

}
