#include using namespace std; typedef long long ll; int main() { int N; cin >> N; while(N){ if(N % 10 == 3){ N /= 10; } else if(N % 10 == 1){ cout << 1 << endl; return 0; } else break; } cout << -1 << endl; return 0; }