/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: cteam025 * * Created on October 28, 2017, 11:26 AM */ #include #include using namespace std; /* * */ int main(int argc, char** argv) { ios::sync_with_stdio(false); while (cin.good()){ int s; char letter; cin >> s >> letter; if (!cin.good()){ return 0; } switch(letter){ case 'N': if (s <= 2){ cout << 1 << endl; }else{ cout << 3 << endl; } break; case 'R': cout << s << endl; break; case 'B': cout << s << endl; break; case 'K': if (s <= 1){ cout << 1 << endl; }else{ cout << 4 << endl; } break; } } return 0; }