#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int count = 0;
  char p = str[0];
  for (int i = 1; i < str.size(); i++) {
    if (str[i] != p) {
      count++;
      i++;
      p = str[i];
    }
  }
  cout << n - count << endl;
  return 0;
}
