let create_x : int -> vec[int] =
  fun n : int ->
    let result : vec[int] = vector n 0 in
    for i = 0 to n do
      vector_set result i i
    done ;
    result
in
let create_y : vec[int] -> vec[int] =
  fun x : vec[int] ->
    let n : int = vector_length x in
    let result : vec[int] = vector n 0 in
    for i = 0 to n do
      vector_set result ((n - i) - 1) (vector_get x ((n - i) - 1))
    done ;
    result
in
let my_try : int -> int =
  fun n : int ->
    vector_length (create_y (create_x n))
in
let rec go : int -> int -> int -> int =
  fun (m : int) (n : int) (r : int) ->
    if 0 < m then
      go (m - 1) n (my_try n)
    else
      r
in
let input1 : int = read_int () in
let input2 : int = read_int () in
print_int (go input1 input2 0)
