#include<iostream>
using namespace std;

class tech{
    public:
    virtual int istech(int n){ return 0;}
    virtual int istech(float n){return 0;}
};

class check: public tech{
    public:
    int istech(int n)override{
        if(n<1000 || n> 9999) return 0;
        int sum=(n/100)+(n%100);
        return (sum*sum==n);
    }
};
int main(){
    int type;
    if(!(cin>>type)){cout<<"Invalid Input"<<endl; return 0;}
    if(type!=1 && type !=2){cout<<"-1"<<endl; return 0;}
    check obj;
    if(type4==1){
        int n;
        if(!(cin>.n)) cout<<"Invalid Input"<<endl;
        else cout<<obj.istech(n)<<endl;
    }
    else{
        float f;
        if(!(cin>>f))cout<<"Invalid Input"<<endl;
        else cout<< obj.istech(f)<<endl;
    }
    return 0;
}