import math._ object Main { def calc(A: Int, B: Int): Int = { var n = 1 while (true) { for (i <- 1 to n) { val a = i val b = n - i var x = (100.0 * a) / (a + b) var y = (100.0 * b) / (a + b) x = floor(x + 0.5) y = floor(y + 0.5) if ((x == A && y == B) || (x == B && y == A)) return n } n += 1 } println("not found") return 0 } def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val a, b = sc.nextInt println(calc(a, b)) } }