#include <bits/stdc++.h>
using namespace std;
bool check(string s) {
  if (s == "ABC" || s == "ACB" || s == "BAC" || s == "BCA" || s == "CAB" ||
      s == "CBA")
    return 1;
  return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  long long n, cnt = 0;
  ;
  cin >> n;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] != s[i + 1]) {
      cnt++;
      i++;
    }
  }
  cout << n - cnt << '\n';
  return 0;
}
