//Bai 9
#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin()
#define en end()
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
void Run(int n)
{
int ok = 0;
for(int i = 1; i <= sqrt(n); i++)
{
if(i * (i + 5) == n)
{
cout << i;
ok = 1;
break;
}
}
if(ok == 0) cout << "NO";
}
int main()
{
Faster;
int n; cin >> n;
Run(n);
return 0;
}
Ly9CYWkgOQoKI2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4oKQojZGVmaW5lIGVuIGVuZCgpCiNkZWZpbmUgRmFzdGVyIGNpbi50aWUoMCk7IGNvdXQudGllKDApOyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoKdm9pZCBSdW4oaW50IG4pCnsKICAgIGludCBvayA9IDA7CiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IHNxcnQobik7IGkrKykKICAgIHsKICAgICAgICBpZihpICogKGkgKyA1KSA9PSBuKQogICAgICAgIHsKICAgICAgICAgICAgY291dCA8PCBpOwogICAgICAgICAgICBvayA9IDE7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KICAgIGlmKG9rID09IDApIGNvdXQgPDwgIk5PIjsKfQppbnQgbWFpbigpCnsKICAgIEZhc3RlcjsKICAgIGludCBuOyBjaW4gPj4gbjsKICAgIFJ1bihuKTsKICAgIHJldHVybiAwOwp9Cgo=