Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
num=raw_input()
tmp=map(int, raw_input().split(" "))
#tmp_count=[]
#for i in set(tmp):
#    tmp_count.append(tmp.count(i))

#print set(tmp),tmp_count
#out=tmp[:]
#for i,j in zip(set(tmp),tmp_count):

#out=tmp[:]
#for i in tmp:
#    out.append(i-1)
#    out.append(i+1)

arr1=np.array(tmp)
arr2=np.array(tmp)+1
arr3=np.array(tmp)-1
arr=np.r_[arr1, arr2,arr3]
#print np.median(arr)
sub=[]
for i in set(arr):
    sub.append(list(arr).count(i))
#print sub
print max(sub)


Fixed submission:
import numpy as np
from collections import Counter
#from statistics import mode
num=raw_input()
tmp=map(int, raw_input().split(" "))
#tmp_count=[]
#for i in set(tmp):
#    tmp_count.append(tmp.count(i))

#print set(tmp),tmp_count
#out=tmp[:]
#for i,j in zip(set(tmp),tmp_count):

#out=tmp[:]
#for i in tmp:
#    out.append(i-1)
#    out.append(i+1)

arr1=np.array(tmp)
arr2=np.array(tmp)+1
arr3=np.array(tmp)-1
arr=np.r_[arr1, arr2,arr3]
#print arr
data = Counter(list(arr))
print data.most_common(1)[0][1]
#print mode(list(arr))
#print np.median(arr)
"""
sub=[]
for i in set(arr):
    sub.append(list(arr).count(i))
#print sub
print max(sub)
"""

Buggy python submission (verdict: Time Limit Exceeded):
num=raw_input()
tmp=map(int, raw_input().split(" "))
#tmp_count=[]
#for i in set(tmp):
#    tmp_count.append(tmp.count(i))

#print set(tmp),tmp_count
#out=tmp[:]
#for i,j in zip(set(tmp),tmp_count):
out=tmp[:]
for i in tmp:
    out.append(i-1)
    out.append(i+1)

#print set(out)

sub=[]
for i in set(out):
    sub.append(out.count(i))
#print sub
print max(sub)


Fixed submission:
import numpy as np
from collections import Counter
#from statistics import mode
num=raw_input()
tmp=map(int, raw_input().split(" "))
#tmp_count=[]
#for i in set(tmp):
#    tmp_count.append(tmp.count(i))

#print set(tmp),tmp_count
#out=tmp[:]
#for i,j in zip(set(tmp),tmp_count):

#out=tmp[:]
#for i in tmp:
#    out.append(i-1)
#    out.append(i+1)

arr1=np.array(tmp)
arr2=np.array(tmp)+1
arr3=np.array(tmp)-1
arr=np.r_[arr1, arr2,arr3]
#print arr
data = Counter(list(arr))
print data.most_common(1)[0][1]
#print mode(list(arr))
#print np.median(arr)
"""
sub=[]
for i in set(arr):
    sub.append(list(arr).count(i))
#print sub
print max(sub)
"""

Buggy python submission (verdict: Time Limit Exceeded):
num=raw_input()
tmp=map(int, raw_input().split(" "))
tmp_count=[]
for i in set(tmp):
    tmp_count.append(tmp.count(i))

#print set(tmp),tmp_count
out=tmp[:]
for i,j in zip(set(tmp),tmp_count):
    for k in range(j):
        out.append(i-1)
        out.append(i+1)

#print set(out)

sub=[]
for i in set(out):
    sub.append(out.count(i))
#print sub
print max(sub)


Fixed submission:
import numpy as np
from collections import Counter
#from statistics import mode
num=raw_input()
tmp=map(int, raw_input().split(" "))
#tmp_count=[]
#for i in set(tmp):
#    tmp_count.append(tmp.count(i))

#print set(tmp),tmp_count
#out=tmp[:]
#for i,j in zip(set(tmp),tmp_count):

#out=tmp[:]
#for i in tmp:
#    out.append(i-1)
#    out.append(i+1)

arr1=np.array(tmp)
arr2=np.array(tmp)+1
arr3=np.array(tmp)-1
arr=np.r_[arr1, arr2,arr3]
#print arr
data = Counter(list(arr))
print data.most_common(1)[0][1]
#print mode(list(arr))
#print np.median(arr)
"""
sub=[]
for i in set(arr):
    sub.append(list(arr).count(i))
#print sub
print max(sub)
"""