#include #define rep(i,n) for(int i=0;i P; const int INF = 1e9; const int MOD = 1000000007; int main(){ int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; int ans = 0; vector

k = {P(a[0],0)}; rep(i,n){ if(k.back().first == a[i]){ k.back().second ++; }else{ k.emplace_back(P(a[i],1)); } } bool ok = true; for(P p:k){ if(p.second > 1) ans += p.second - 1; else{ if(ok){ ans ++; ok = false; }else{ ok = true; } } } cout << ans << endl; return 0; }