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