#include <bits/stdc++.h>
using namespace std;
int n;
char str[200005];
int main() {
  while (~scanf("%d", &n)) {
    scanf("%s", str);
    int sum = 0;
    int r = 0, l = 0, u = 0, d = 0;
    for (int i = 0; i < n; i++) {
      if (str[i] == 'L') {
        if (r == 1) {
          sum++;
          l = 0;
          r = 0;
          u = 0;
          d = 0;
        }
        l = 1;
      }
      if (str[i] == 'R') {
        if (l == 1) {
          sum++;
          l = 0;
          r = 0;
          u = 0;
          d = 0;
        }
        r = 1;
      }
      if (str[i] == 'U') {
        if (d == 1) {
          sum++;
          l = 0;
          r = 0;
          u = 0;
          d = 0;
        }
        u = 1;
      }
      if (str[i] == 'D') {
        if (u == 1) {
          sum++;
          l = 0;
          r = 0;
          u = 0;
          d = 0;
        }
        d = 1;
      }
    }
    printf("%d\n", sum + 1);
  }
  return 0;
}
