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: 
  // 入力マクロ
  // https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
  macro_rules! input {
      (source = $s:expr, $($r:tt)*) => {
          let mut iter = $s.split_whitespace();
          let mut next = || { iter.next().unwrap() };
          input_inner!{next, $($r)*}
      };
      ($($r:tt)*) => {
          let stdin = std::io::stdin();
          let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
          let mut next = move || -> String{
              bytes
                  .by_ref()
                  .map(|r|r.unwrap() as char)
                  .skip_while(|c|c.is_whitespace())
                  .take_while(|c|!c.is_whitespace())
                  .collect()
          };
          input_inner!{next, $($r)*}
      };
  }
  macro_rules! input_inner {
      ($next:expr) => {};
      ($next:expr, ) => {};
  
      ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
          let $var = read_value!($next, $t);
          input_inner!{$next $($r)*}
      };
  }
  macro_rules! read_value {
      ($next:expr, ( $($t:tt),* )) => {
          ( $(read_value!($next, $t)),* )
      };
  
      ($next:expr, [ $t:tt ; $len:expr ]) => {
          (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
      };
  
      ($next:expr, chars) => {
          read_value!($next, String).chars().collect::<Vec<char>>()
      };
  
      ($next:expr, usize1) => {
          read_value!($next, usize) - 1
      };
  
      ($next:expr, $t:ty) => {
          $next().parse::<$t>().expect("Parse error")
      };
  }
  
  
  
  fn main() {
      input! {
          n: usize,
          a: [usize; n]
      }
  
      let mut count = vec![0; 100_002];
      for i in a {
          count[i] += 1;
          count[i+1] += 1;
          count[i+ 2] += 1;
      }
  
      let ans = count.iter().max().unwrap();
      println!("{}", 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"}]