f | from math import sqrt | f | from math import sqrt |
| seq = set(eval(input())) | | seq = set(eval(input())) |
| M = max(seq) | | M = max(seq) |
n | set_sqr = set() | n | summ = set() |
| for i in range(1, int(sqrt(M)) + 1): | | for i in range(1, int(sqrt(M)) + 1): |
| for j in range(i, int(sqrt(M - i * i)) + 1): | | for j in range(i, int(sqrt(M - i * i)) + 1): |
t | for k in range(j, int(sqrt(M - i * i - j * j)) + 1): | t | for z in range(j, int(sqrt(M - i * i - j * j)) + 1): |
| set_sqr.add(i * i + j * j + k * k) | | summ.add(i * i + j * j + z * z) |
| print(len(set_sqr & seq)) | | print(len(summ & seq)) |