#include using namespace std; int main(){ char c1,c2,c3; cin>>c1>>c2>>c3; cout<<(c2=='?'?"14":c2=='2'?"4":"1")<