#include "bits/stdc++.h" using namespace std; using ll = long long; using Graph = vector>; #define int ll #define double long double void YN(bool flg){cout<<(flg?"YES":"NO")< VI; typedef vector VVI; const int MOD = 1000000007; const long long INF = 10e10; const double PI = acos(-1.0); template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } templateauto MAX(const T& a) { return *max_element(a.begin(),a.end()); } templateauto MIN(const T& a) { return *min_element(a.begin(),a.end()); } templateU SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); } templateint LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); } templateint UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); } int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; } int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; } //------------------------------------------------------------------------------------------------------ signed main(){ cin.tie(0); ios::sync_with_stdio(0); cout<> n; VI a(n); REP(i,n) cin >> a[i]; int count = 0; REP(i,n){ if(a[i-1]!=a[i]){count++; i++;} } cout << n-count << endl; return 0; }