#!/bin/python3 import sys n = int(input().strip()) a = [int(a_temp) for a_temp in input().strip().split(' ')] count = {} for i in a: count[i] = count.get(i,0)+1 if i > 0: count[i-1] = count.get(i-1,0)+1 max_count = 0 for i,c in count.items(): if max_count < c : max_count=c print(max_count)