#include <bits/stdc++.h>
int main() {
  char a[1000];
  int i, j, d, n, len, len2;
  d = 0;
  j = 0;
  scanf("%d", &n);
  getchar();
  gets(a);
  len = strlen(a);
  len2 = len;
  while (j < len - 1) {
    if (a[j] == 'R' && a[j + 1] == 'U') {
      len2 = len2 - 2;
      d++;
      j = j + 2;
    } else if (a[j] == 'U' && a[j + 1] == 'R') {
      len2 = len2 - 2;
      d++;
      j = j + 2;
    } else
      j++;
  }
  printf("%d", d + len2);
}
