package m.shin; import java.util.Scanner; public class Con203 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String[] w = {s.next() , s.next()}; s.close(); int max = 0 , k = 0; for(int i = 0;i < 2;i++){ for(int j = 0;j < 7;j++){ if(w[i].charAt(j) == 'o'){ k++; }else{ max = Math.max(max, k); k = 0; } } } max = Math.max(max, k); System.out.println(max); } }