#!/usr/bin/python # -*- coding: utf-8 -*- S = raw_input() + raw_input() ans,tmp = 0,0 for s in S: if s == "o": tmp += 1 else: ans = max(ans,tmp) tmp = 0 print max(ans,tmp)