#28047: Python 寫的有點爛的解法...


712045@st.lths.tc.edu.tw (程式餓靈)


while(True):

    try:

        while(True):

            Inp=input()

            InpList=Inp.split(' ')

            if((int(InpList[0])-int(InpList[1]))>0):    

                print(1+int(InpList[1]))

            else:

                print(int(InpList[1]))

    except:

        break