output_description: Print the maximum possible number of i such that a_i=X.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
      a_1 a_2 .. a_N
attempt: import numpy as np
  N = int(input())
  a_s = input().split()
  for i in range(N):
      a_s[i] = int(a_s[i])
  a_s = np.array(a_s)
  
  a_unique = np.unique(a_s)
  # a_counts = []
  # for i,a in enumerate(a_unique):
  #     a_counts.append(np.sum(a_s==a))
  # a_counts = np.array(a_counts)
  
  ans = 0
  for i in range(len(a_unique)):
      val = np.sum(a_s==a_unique[i] #a_counts[i]
      if (i>0):
          if (a_unique[i-1]+1==a_unique[i]):
              val += np.sum(a_s==a_unique[i-1]) #a_counts[i-1]
              
      if (i<len(a_unique)-1):
          if (a_unique[i+1]-1==a_unique[i]):
              val += np.sum(a_s==a_unique[i+1]) #a_counts[i+1]
      
      if val > ans:
          ans = val
          
  #     if ans >= sum(a_counts[i:]):
  #         break
          
  print(ans)
problem_description: Statement
  
  You are given an integer sequence of length N, a_1,a_2,...,a_N.
  
  For each 1≤i≤N, you have three choices: add 1 to a_i, subtract 1 from a_i or
  do nothing.
  
  After these operations, you select an integer X and count the number of i such
  that a_i=X.
  
  Maximize this count by making optimal choices.
samples: [{"input": "7\n    3 1 4 1 5 9 2", "output": "4\n    \n\nFor example, turn the sequence into 2,2,3,2,6,9,2 and select X=2 to obtain 4,\nthe maximum possible count.\n\n* * *"}, {"input": "10\n    0 1 2 3 4 5 6 7 8 9", "output": "3\n    \n\n* * *"}, {"input": "1\n    99999", "output": "1"}]