#include <bits/stdc++.h>
using namespace std;
int ans, i, n, dx, dy, mx, my;
char sir[200010];
int main() {
  cin >> n;
  cin >> sir;
  ans = 1;
  for (i = 0; i < n; i++) {
    dx = dy = 0;
    if (sir[i] == 'R') dx = 1;
    if (sir[i] == 'U') dy = -1;
    if (sir[i] == 'D') dy = 1;
    if (sir[i] == 'L') dx = -1;
    if (dx * mx == -1 || dy * my == -1) mx = my = 0, ans++;
    if (mx == 0) mx = dx;
    if (my == 0) my = dy;
  }
  cout << ans;
  return 0;
}
