main = getContents >>= print . area_of_polygon . map (map read . splitOn ',') . lines

area_of_polygon (p1:p2:p3:ps) = heron a b c + area_of_polygon (p1:p3:ps)
 where
  (a,b,c) = (distance p1 p2, distance p2 p3, distance p3 p1)
  distance [x1,y1] [x2,y2] = sqrt $ (x2-x1)^2 + (y2-y1)^2
  heron a b c = sqrt $ z * (z-a) * (z-b) * (z-c)
   where z = (a + b + c) / 2 
area_of_polygon _ = 0

splitOn c xs
 | null xs = []
 | head xs == c = splitOn c (tail xs)
 | otherwise = (takeWhile (/= c)) xs : splitOn c (dropWhile (/= c) xs)