#include <bits/stdc++.h>
using namespace std;
int n, re;
int dx, dy;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    int x = 0;
    int y = 0;
    if (s[i] == 'L') {
      x = -1;
    } else if (s[i] == 'R') {
      x = 1;
    } else if (s[i] == 'U') {
      y = 1;
    } else {
      y = -1;
    }
    if (!dx) {
      dx = x;
    }
    if (!dy) {
      dy = y;
    }
    if ((x && dx != x) || (y && dy != y)) {
      re++;
      dx = x;
      dy = y;
    }
  }
  cout << re + 1;
  return 0;
}
