#include <bits/stdc++.h>
int main() {
  int n, i, j, sum = 1, a[100], c[10];
  char b[200005];
  scanf("%d", &n);
  getchar();
  scanf("%s", b);
  a['U'] = 0;
  a['D'] = 3;
  a['L'] = 1;
  a['R'] = 2;
  for (i = 0; i < n; i++) {
    if (c[3 - a[b[i]]]) {
      sum++;
      c[0] = c[1] = c[2] = c[3] = 0;
    }
    c[a[b[i]]] = 1;
  }
  printf("%d", sum);
  return 0;
}
