import sequtils,math proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord let n = scan() const INF = 1000_0010 const C = (proc():seq[int] = result = @[] for i in 1..INF: let c = i * (i + 1) div 2 if c > INF : break result &= c )() block: let nsq = (n*2).float.sqrt.int if nsq * (nsq + 1) div 2 == n: quit "1", 0 for i in 0.. n : break echo 3