#include<iostream>
#include<string>
using namespace std;
int main(){
    string a,b;
    int vac=0,m_vac=0;
    cin >> a >> b;
    a+=b;
    for(int i=0;i<a.length();i++){
        if(a[i]=='o'){
            vac++;
            m_vac = max(vac,m_vac);
        }
        else vac=0;
    }
    cout << m_vac << endl;
}