#include <bits/stdc++.h>
using namespace std;
char ch[110];
int n, ans1, ans2;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> ch;
  char la = ch[0];
  for (int i = 1; i < n; i++)
    if (la != ch[i] && la != 0) {
      ans1++;
      la = 0;
    } else
      la = ch[i];
  la = ch[n - 1];
  for (int i = n - 2; i >= 0; i--)
    if (la != ch[i] && la != 0) {
      ans2++;
      la = 0;
    } else
      la = ch[i];
  cout << n - max(ans1, ans2) << endl;
  return 0;
}
