f | from math import sqrt | f | from math import sqrt |
| seq = set(eval(input())) | | seq = set(eval(input())) |
| M = max(seq) | | M = max(seq) |
t | sum_of_squares = {i * i + j * j + k * k for i in range(1, int(sqrt(M)) + | t | square = {i * i + j * j + k * k for i in range(1, int(sqrt(M)) + 1) for |
| 1) for j in range(i, int(sqrt(M - i * i) + 1)) for k in range(j, int(sq | | j in range(i, int(sqrt(M - i * i)) + 1) for k in range(j, int(sqrt(M - i |
| rt(M - i * i - j * j) + 1))} | | * i - j * j)) + 1)} |
| print(len(sum_of_squares & seq)) | | print(len(square & seq)) |