#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
char a[N];
int main(void) {
  int n;
  int ans = 1;
  int n1 = 0;
  int n2 = 0;
  cin >> n;
  scanf("%s", a);
  for (int i = 0; i < n; i++) {
    if (a[i] == 'L') {
      if (n1 == 1) {
        ans++;
        n2 = 0;
      }
      n1 = 2;
    }
    if (a[i] == 'R') {
      if (n1 == 2) {
        ans++;
        n2 = 0;
      }
      n1 = 1;
    }
    if (a[i] == 'U') {
      if (n2 == 1) {
        ans++;
        n1 = 0;
      }
      n2 = 2;
    }
    if (a[i] == 'D') {
      if (n2 == 2) {
        ans++;
        n1 = 0;
      }
      n2 = 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
