lib C fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64 end class String def to_i64 C.strtoll(self, nil, 10) end end n = read_line.to_i a = (1..n).map { read_line.to_i }.sort q = Deque.new(a[...1]) a[1..].each do |i| if q[0] + 1 < i q.shift end q.push(i) end puts q.size