import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.Arrays; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); int[] days = new int[14 + 1]; String[] inputs = reader.readLine().split(""); for (int i = 0; i < 7; i++) { if (inputs[i].equals("o")) { days[i + 1] = 1; } else { days[i + 1] = 0; } } inputs = reader.readLine().split(""); for (int i = 7; i < 14; i++) { if (inputs[i - 7].equals("o")) { days[i+1] = 1; } else { days[i+1] = 0; } } for (int i = 1; i <= 14; i++) { if (days[i] == 0) { } else { days[i] = days[i] + days[i - 1]; } } int longest=0; for (int i = 0; i <= 14; i++) { longest = Math.max(longest,days[i]); } System.out.println(longest); } }