#include using namespace std; int main(){ string s;cin>>s; int sum=0; if(s[0]!='1'||s.size()==1){ cout<<-1<