#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a;
  cin >> a;
  string str;
  cin >> str;
  int count = 0;
  char pre = '\0';
  for (int i = 0; i < a; i++) {
    if (pre != '\0') {
      if (pre != str[i]) {
        pre = '\0';
      } else {
        count++;
      }
    } else {
      count++;
      pre = str[i];
    }
  }
  cout << count << "\n";
  return 0;
}
