两个网站都通过
#include <iostream>
using namespace std;
const int N = 1010;
int n;
int a[N];
int main()
{
cin >> n;
for(int i = 0; i < n; ++ i) cin >> a[i];
int cnt = 0, i = 0;
while(i < n)
{
int j = i + 1;
while(a[j] == a[j - 1] && j < n) j ++;
cnt ++;
i = j;
}
cout << cnt << endl;
return 0;
}