#include <bits/stdc++.h>
int main(void) {
  int n, a, b, count = 0;
  scanf("%i", &n);
  for (a = 5; a <= n; a++)
    for (b = a; b > 0; b--) {
      int c = (int)sqrt((float)(a * a - b * b));
      if (b * b + c * c == a * a && c != 0 && c < b) count++;
    }
  printf("%i\n", count);
  return 0;
}
