#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
int t, n, m, a[N], c[N], ans;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == s[i + 1])
      ans++;
    else
      ans++, i++;
  }
  cout << ans;
  return 0;
}
