#include #define rep(i,n) for(int i=0;i ; const int INF = 1e9; const int MOD = 1000000007; int main(){ string s; cin >> s; if(s[0] != '1'){ cout << -1 << endl; return 0; } for(int i=1;i