#include "bits/stdc++.h" using namespace std; #define int long long #define endl '\n' int mod=1e9+7; signed main(){ double x,y; cin>>x>>y; //x=sqrt(x); //y=sqrt(y); //x=ceil(x); //y=ceil(y); int maxn=sqrt(1e7); vector ans(1e7+1,0); for(double i=-1*maxn;i<=maxn;i++){ for(double j=-1*maxn;j<=maxn;j++){ double tmp=i*i+j*j; if(tmp<=1e7)ans[tmp]++; } } if(x==y){ cout<