#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b = 0, c = 0, d = 0, kol = 1;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L') a = 1;
    if (s[i] == 'R') b = 1;
    if (s[i] == 'D') c = 1;
    if (s[i] == 'U') d = 1;
    if ((a + b == 2) or (c + d == 2)) {
      a = 0;
      b = 0;
      c = 0;
      d = 0;
      kol++;
      if (s[i] == 'L') a = 1;
      if (s[i] == 'R') b = 1;
      if (s[i] == 'D') c = 1;
      if (s[i] == 'U') d = 1;
    }
  }
  cout << kol;
}
