#include using namespace std; int main(){char B;cin>>B>>B; cout<<(B=='?'?"14":(B=='2'?"4":"1"))<<"\n"; }