let id x = x
let xa = Scanf.scanf "%d\n" id

let x = if xa < 0 then xa * (-1) else xa

let rec func x i =
  if i = x then i else
    if x - i > i then func (x-i) (i+1) else x
    
let ans = func x 1

let () = Printf.printf "%d\n" ans
