f | from math import sqrt | f | from math import sqrt |
| seq = set(eval(input())) | | seq = set(eval(input())) |
t | seq_max = max(seq) | t | M = max(seq) |
| three_squares_set = set((i * i + j * j + k * k for i in range(1, int(sqr | | GTAV = set((i * i + j * j + k * k for i in range(1, int(sqrt(M)) + 1) fo |
| t(seq_max)) + 1) for j in range(i, int(sqrt(seq_max - i * i)) + 1) for k | | r j in range(i, int(sqrt(M - i * i)) + 1) for k in range(j, int(sqrt(M - |
| in range(j, int(sqrt(seq_max - i * i - j * j)) + 1))) | | i * i - j * j)) + 1))) |
| print(len(seq & three_squares_set)) | | print(len(seq.intersection(GTAV))) |