#include #include #include using namespace std; int main(){ string s; cin>>s; int T; cin>>T; int h=0; for(auto c:s){ if(c=='V') h+=5; if(c=='I') h+=1; if(c=='X') h=10-h; } h+=T+1200; h%=12; if(!h)h=12; cout<