import Data.List
import Data.List.Split

fib :: Int -> Int -> Int -> Int
fib 0 x _ = x
fib n x y = fib (n-1) y (x+y)

main = do
  lines <- getContents
  let s:_ = splitOn "\n" lines
  print
    $ foldr (+) 0
    $ take 2
    $ sort
    $ map (read::String -> Int)
    $ splitOn " " s
