local function getgcd(x, y) while 0 < x do x, y = y % x, x end return y end local n = io.read("*n") local t = {} for i = 1, n do t[i] = io.read("*n") end local ret = 0 for i = 1, n - 2 do for j = i + 1, n - 1 do for k = j + 1, n do local z = getgcd(getgcd(t[i], t[j]), t[k]) if z == 1 then ret = ret + 1 end end end end print(ret)