#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 5;
int main() {
  int n, cnt = 0;
  bool judge = 0;
  char ch[maxn];
  cin >> n;
  cin >> ch[1];
  for (int i = 2; i <= n; i++) {
    cin >> ch[i];
    if (judge)
      judge = 0;
    else if (ch[i] - ch[i - 1]) {
      cnt++;
      judge = 1;
    }
  }
  cout << n - cnt << endl;
  return 0;
}
