#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <algorithm>
using namespace std ;
int main() {
int n;
vector < int > nums;
// 注意 while 处理多个 case
while ( cin >> n) {
nums. clear ();
for ( int i = 0 ; i < n; ++i) {
int element;
cin >> element;
nums. push_back (element);
}
sort (nums. begin (), nums. end ());
int sum = 0 ;
int count = 1 ;
int flag = true ;
for ( int i = 1 ; i < n; ) {
int temp = nums[ i ] - nums[ i - 1 ];
if (temp <= 10 ) {
++i;
++count;
flag = true ;
if (count == 3 ) {
if (i >= n) {
flag = false ;
break ;
}
++i;
count = 1 ;
flag = true ;
}
} else if (temp > 10 && temp <= 20 ) {
if (count == 1 ) {
i += 2 ;
++sum;
flag = false ;
} else if (count == 2 ) {
++i;
count = 1 ;
++sum;
flag = true ;
}
} else if (temp > 20 ) {
if (count == 1 ) {
++i;
sum += 2 ;
} else if (count == 2 ) {
++i;
count = 1 ;
++sum;
}
flag = true ;
}
}
if (count == 1 && flag) {
sum += 2 ;
}
if (count == 2 ) ++sum;
cout << sum << endl ;
}
return 0 ;
}