#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  string s;
  while (cin >> n >> s) {
    int sum = 0;
    int left = 0, right = 0, up = 0, down = 0;
    for (i = 0; i < n; i++) {
      if (s[i] == 'R') {
        if (left == 1) {
          sum++;
          left = 0;
          up = 0;
          down = 0;
        }
        right = 1;
      } else if (s[i] == 'L') {
        if (right == 1) {
          sum++;
          right = 0;
          up = 0;
          down = 0;
        }
        left = 1;
      } else if (s[i] == 'U') {
        if (down == 1) {
          sum++;
          down = 0;
          left = 0;
          right = 0;
        }
        up = 1;
      } else if (s[i] == 'D') {
        if (up == 1) {
          sum++;
          up = 0;
          left = 0;
          right = 0;
        }
        down = 1;
      }
    }
    cout << sum + 1 << endl;
  }
  return 0;
}
