#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<char> v;
  int n, s = 0;
  char c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    v.push_back(c);
  }
  for (int i = 1; i < v.size(); i++) {
    if (v[i] != v[i - 1]) {
      s++;
      i++;
    }
  }
  cout << v.size() - s << endl;
  return 0;
}
