using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var k = int.Parse(line[1]); getAns(n, k); } static void getAns(int n, int k) { if (n == 1) { Console.WriteLine(1); return; } Console.WriteLine(k == n - 1 ? n : n - 1); } }