#include #include using namespace std; int main() { string s; while(cin>>s){ if(s=="SS")break; char a; cin>>a; int cnt=0; for(int i=0;i