#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n, p[100005], ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (p[i] == p[i + 1]) {
      swap(p[i], p[i + 1]);
    }
  }
  cout << ans << endl;
  return (0);
}
