#include <iostream>
using namespace std;
void pitagoras(int N)
{
int l = 0;
for(int a = 99; a <= N - 2; a ++){
for(int b = a+1; b <= N - 1; b++){
for(int c = b + 1; c <= N; c++){
if(a * a + b * b == c * c){
l++;
}
}
}
}
cout << l << endl;
}
int main(){
pitagoras(999);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBwaXRhZ29yYXMoaW50IE4pCnsKICAgICAgICBpbnQgbCA9IDA7CiAgICAgICAgZm9yKGludCBhID0gOTk7IGEgPD0gTiAtIDI7IGEgKyspewogICAgICAgICAgICAgICAgZm9yKGludCBiID0gYSsxOyBiIDw9IE4gLSAxOyBiKyspewogICAgICAgICAgICAgICAgICAgICAgICBmb3IoaW50IGMgPSBiICsgMTsgYyA8PSBOOyBjKyspewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGEgKiBhICsgYiAqIGIgPT0gYyAqIGMpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCsrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBjb3V0IDw8IGwgPDwgZW5kbDsKfQoKaW50IG1haW4oKXsKICAgICAgICBwaXRhZ29yYXMoOTk5KTsKfQo=