let arr = [| 390; 429; 468; 507; 546 |] let [| l; s |] = stdin.ReadLine().Split() l |> int |> fun x -> if s = "Beat" then arr.[x] else arr.[x - 1] |> printfn "%d"