#include <bits/stdc++.h>   using namespace std;   int a[200005], ans1 = 1, ans2 = 0;   int main() {     int n, b, b1;     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf( %d , &a[i]);     }     sort(a + 1, a + 1 + n);     b1 = 0;     for (int i = 2; i <= n; ++i) {       b = a[i] - a[i - 1];       if (b == 0) {         continue;       } else if (b == 1) {         if (b1 == 2) {           ans1++;           b1 = 0;         } else if (b1 == 1) {           b1 = 2;         } else if (b1 == 0) {           b1 = 1;         }       } else if (b == 2) {         if (b1 == 0) {           b1 = 2;         } else if (b1 >= 1) {           b1 = 0;           ans1++;         }       } else {         b1 = 0;         ans1++;       }     }     for (int i = 1; i <= n; ++i) {       b = a[i] - a[i - 1];       if (i == 1) {         a[i]--;         ans2++;         continue;       }       if (b >= 1) ans2++;       if (b == 0 && a[i] != a[i + 1]) {         ans2++;         a[i]++;       } else if (b == 1 && a[i] == a[i + 1] - 1) {         continue;       } else if (b == 1 && a[i] == a[i + 1] - 2) {         continue;       } else if (b == 1 && a[i] != a[i + 1]) {         a[i]++;       } else if (b >= 2) {         a[i]--;       }     }     printf( %d %d n , ans1, ans2);     return 0;   }   