from itertools import combinations as comb
def solution(nums):
answer = 0
sieve = [True]*(sum(nums)+1)
m = int(sum(nums)**0.5)
for i in range(2,m+1):
if sieve[i] == True:
for j in range(2*i,sum(nums)+1,i):
sieve[j] = False
for i in list(comb(nums,3)):
if sieve[sum(i)]:
answer += 1
return answer