import java.io.*; import java.util.*; import java.math.*; class Main203 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line1 = br.readLine(); String line2 = br.readLine(); String line3 = line1 + line2; int ans = 0, cnt = 0; for (int i = 0; i < line3.length(); i++) { char c = line3.charAt(i); if (c == 'o') { cnt++; } else { ans = Math.max(ans, cnt); cnt = 0; } } System.out.println(Math.max(ans , cnt)); } }