f::Int->Int->Int->Int->Bool
f a b c d
    |c<a=True
    |c==a && d<=b=True
    |otherwise =False

main = do
      x<-getLine
      let (a:b:[])=map read (words x)::[Int]
      putStrLn $ show $ length [1|y<-[1..12],f a b y y]