#include<iostream> using namespace std; int main(){ double a,b; cin>>a>>b; if(a==1){ cout<<(8+b-1); } else{ cout<<(10+2*(b-1)); } return 0; }