import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc s = s.replaceAll("A", "-") s s.replaceAll("A", "-") s.replaceAll s "A" "-" s = s.replaceAll("C", "-") s s.replaceAll("C", "-") s.replaceAll s "C" "-" s = s.replaceAll("T", "-") s s.replaceAll("T", "-") s.replaceAll s "T" "-" s = s.replaceAll("G", "-") s s.replaceAll("G", "-") s.replaceAll s "G" "-" if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("----------") s.contains s "----------" {
			System.out.println(10);
		} System.out.println(10) System.out.println System.out System System.out 10 if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("---------") s.contains s "---------" {
			System.out.println(9);
		} System.out.println(9) System.out.println System.out System System.out 9 if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("--------") s.contains s "--------" {
			System.out.println(8);
		} System.out.println(8) System.out.println System.out System System.out 8 if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("-------") s.contains s "-------" {
			System.out.println(7);
		} System.out.println(7) System.out.println System.out System System.out 7 if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("------") s.contains s "------" {
			System.out.println(6);
		} System.out.println(6) System.out.println System.out System System.out 6 if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("-----") s.contains s "-----" {
			System.out.println(5);
		} System.out.println(5) System.out.println System.out System System.out 5 if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("----") s.contains s "----" {
			System.out.println(4);
		} System.out.println(4) System.out.println System.out System System.out 4 if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("---") s.contains s "---" {
			System.out.println(3);
		} System.out.println(3) System.out.println System.out System System.out 3 if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("--") s.contains s "--" {
			System.out.println(2);
		} System.out.println(2) System.out.println System.out System System.out 2 if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		} s.contains("-") s.contains s "-" {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 String args[] args public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	}
} public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	}
} Main
import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		s = s.replaceAll("A", "-");
		s = s.replaceAll("C", "-");
		s = s.replaceAll("T", "-");
		s = s.replaceAll("G", "-");
		if (s.contains("----------")){
			System.out.println(10);
		} else if (s.contains("---------")){
			System.out.println(9);
		} else if (s.contains("--------")){
			System.out.println(8);
		} else if (s.contains("-------")){
			System.out.println(7);
		} else if (s.contains("------")){
			System.out.println(6);
		} else if (s.contains("-----")){
			System.out.println(5);
		} else if (s.contains("----")){
			System.out.println(4);
		} else if (s.contains("---")){
			System.out.println(3);
		} else if (s.contains("--")){
			System.out.println(2);
		} else if (s.contains("-")){
			System.out.println(1);
		} else{
			System.out.println(0);
		}
	}
}