#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int srs[n];
  for (int i = 0; i < n; i++) {
    cin >> srs[i];
  }
  int count = 0, count1 = 0;
  for (int i = 0; i < n; i++) {
    if (srs[i] != srs[i + 1])
      count++;
    else
      count1++;
  }
  cout << count << " " << count1 << endl;
  return 0;
}
