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 | square = {i * i + j * j + k * k for i in range(1, int(sqrt(M)) + 1) for | t | sum_of_squares = {i * i + j * j + k * k for i in range(1, int(sqrt(M)) + |
| j in range(i, int(sqrt(M - i * i)) + 1) for k in range(j, int(sqrt(M - i | | 1) for j in range(i, int(sqrt(M - i * i) + 1)) for k in range(j, int(sq |
| * i - j * j)) + 1)} | | rt(M - i * i - j * j) + 1))} |
| print(len(square & seq)) | | print(len(sum_of_squares & seq)) |