#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, q, k1, k2, k3, a, b, c;
  string s;
  while (cin >> n) {
    cin >> s;
    int ans = 0;
    for (int i = 1; i < s.length(); i++)
      if (s[i - 1] != s[i]) ans++, i++;
    cout << n - ans << endl;
  }
  return 0;
}
