#include using namespace std; int n, ans; char c; int main() { while(cin >> n >> c) { if(c=='K') { if(n==1) {cout<<1<