let () =
  let f x =
    let x3 = if x > 30 then x-30 else 0 in
    let x2 = if x > 20 then x - x3 -20 else 0 in
    let x1 = if x > 10 then x - x3 - x2 - 10 else 0 in
    4280 - (1150 + x1*125 + x2*140 + x3*160) in
  let rec read () =
    let w = read_int () in
    if w = (-1) then ()
    else
      begin
        Printf.printf "%d\n" (f w);
        read ()
      end
  in read ()
;;