import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s1 = scan.next(); String s2 = scan.next(); scan.close(); int k = 0; int max = 0; for(int i = 0; i < 7; i++) { char c = s1.charAt(i); if(c == 'o') { k ++; }else { k = 0; } if(max < k) { max = k; } } for(int i = 0; i < 7; i++) { char c = s2.charAt(i); if(c == 'o') { k ++; }else { k = 0; } if(max < k) { max = k; } } System.out.println(max); } }