#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  bool up = false, down = false, left = false, right = false;
  long long count = 0;
  char ch;
  for (long long i = 0; i < n; i++) {
    cin >> ch;
    if (ch == 'R') {
      if (left) {
        count++;
        up = false;
        down = false;
        left = false;
        right = false;
      }
      right = true;
    }
    if (ch == 'L') {
      if (right) {
        count++;
        up = false;
        down = false;
        left = false;
        right = false;
      }
      left = true;
    }
    if (ch == 'U') {
      if (down) {
        count++;
        up = false;
        down = false;
        left = false;
        right = false;
      }
      up = true;
    }
    if (ch == 'D') {
      if (up) {
        count++;
        up = false;
        down = false;
        left = false;
        right = false;
      }
      down = true;
    }
  }
  cout << count + 1;
  return 0;
}
