plus :: [Integer] -> Integer
plus [] = 0
plus (x:xs) = x + plus xs

mult :: [Integer] -> Integer
mult [] = 1
mult (x:xs) = x * mult xs

rect_area :: [Integer] -> Integer
rect_area xs = plus xs * 2

rect_circumference :: [Integer] -> Integer
rect_circumference xs = mult xs

main = do
  str <- getLine
  print $ rect_circumference [read x | x <- (words str)]
  print $ rect_area [read x | x <- (words str)]