#include <bits/stdc++.h>
using namespace std;
int main() {
  (ios::sync_with_stdio(false), cin.tie(NULL));
  int n;
  cin >> n;
  double start = clock();
  string seq;
  cin >> seq;
  int len(0);
  for (int i = 0; i < n - 1; i++) {
    if (seq[i] != seq[i + 1]) {
      len++;
      i += 1;
    }
  }
  cout << n - len << "\n";
  cerr << "[*] Time: " << (clock() - start) * 1.0 / CLOCKS_PER_SEC
       << std::setprecision(3) << " s"
       << "\n";
  return 0;
}
