#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  ios_base::sync_with_stdio(0);
  cin >> N;
  string K;
  cin >> K;
  int zm = N;
  for (int i = 1; i < N; i++) {
    if (K[i] != K[i - 1]) {
      zm--;
      if (i < N - 1) K[i] = K[i + 1];
    }
  }
  cout << zm;
}
