#!/bin/ruby n = gets.strip.to_i a = gets.strip a = a.split(' ').map(&:to_i) m = 0 a.each do |x| temp = 0 a.each do |y| temp += 1 if (1 >= (x - y) && (x - y) >= 0) m = temp if (temp > m) end end a.each do |x| temp = 0 a.each do |y| temp += 1 if (-1 <= (x - y) && (x - y) <= 0) m = temp if (temp > m) end end puts m