#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int n;
  scanf("%i", &n);
  string s;
  cin >> s;
  int p = 1;
  int R = 0;
  int L = 0;
  int U = 0;
  int D = 0;
  for (int i = 0; i < n; i++) {
    if (s.substr(i, 1) == "R")
      R++;
    else if (s.substr(i, 1) == "L")
      L++;
    else if (s.substr(i, 1) == "U")
      U++;
    else if (s.substr(i, 1) == "D")
      D++;
    if ((L > 0 and R > 0) or (D > 0 and U > 0)) {
      R = 0;
      L = 0;
      U = 0;
      D = 0;
      p++;
      i--;
    }
  }
  printf("%i\n", p);
  return 0;
}
