f x | x >= 0 = x | otherwise = (-1) main = do l1 <- (foldl1 (*) . take 2 . map read . words) <$> getLine l2 <- (sum . map read . words) <$> getLine print $ f $ l1 - l2