main :: IO ()
main = print . solve . map read . words <$> getLine

solve :: [Int] -> Int
solve xs
  | odd (l * m - s) = (l * (m + 1) - s) `div` (l - 1)
  | otherwise = (l * m - s) `div` (l - 1)
    where
      l = length xs
      m = maximum xs
      s = sum xs