#include <iostream>
using namespace std;
const int N = 1010;
int a[N];
int main(){
int n; cin >> n;
for(int i = 0; i < n; i ++ ) scanf("%d", &a[i]);
int pre = a[0], cnt = 0;
for(int i = 1; i < n; i ++ ){
if(a[i] != pre){
cnt ++ ;
pre = a[i];
}
}
cout << cnt + 1 << endl;
return 0;
}