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