#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  cin >> a;
  string p;
  cin >> p;
  char c1 = 'n';
  char c2 = 'n';
  long long rsp = 0;
  long long tmp = 0;
  long long tmp1 = 0;
  for (long long i = 0; i < p.size(); i++) {
    if (p[i] == 'U' or p[i] == 'D') {
      if (p[i] != c1 and c1 != 'n') {
        rsp++;
        c2 = 'n';
      }
      c1 = p[i];
    }
    if (p[i] == 'L' or p[i] == 'R') {
      if (p[i] != c2 and c2 != 'n') {
        rsp++;
        c1 = 'n';
      }
      c2 = p[i];
    }
  }
  cout << rsp + 1 << endl;
}
