#include <bits/stdc++.h>
using namespace std;
int n, u, r, c;
string a;
int main() {
  cin >> n;
  cin >> a;
  int i = 0;
  while (i < n) {
    if (a[i] != a[i + 1]) {
      i += 2;
      c++;
    } else {
      i++;
      c++;
    }
  }
  cout << c;
}
