main = getLine >>= print . kadomatsu . map read . words kadomatsu [a,b] | a < b = a - 1 | otherwise = 2000000000 - a