#include <bits/stdc++.h>
#include <time.h>

using namespace std;
using LL = long long;

const int MOD = 998244353;

class Edge{
public:
    LL from,to, value;
    Edge(int f,int t, int c){
        from = f;
        to = t;
        value = c;
    }
};

int main(){
    int N;cin >> N;
    vector<int> v,f(N);
    for(int i = 0;i < N;i++){
        int b;cin >> b;
        v.push_back(b);
    }
    for(int i = 0;i < N;){
        f[i] = 1;
        if(i < N-1){
            if(v[i] == v[i + 1]){
                i++;
                continue;
            }
        }
        i += 2;
    }
    cout<<accumulate(f.begin(),f.end(), 0)<<endl;
}