#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1;
  bool l, r, u, d;
  l = u = r = d = false;
  int n;
  cin >> n;
  cin >> s1;
  int ctr = 1;
  for (int i = 0; i < n; i++) {
    char c = s1[i];
    switch (c) {
      case 'R':
        if (l) {
          ctr++;
          l = false;
          u = false;
          d = false;
        }
        r = true;
        break;
      case 'L':
        if (r) {
          ctr++;
          r = false;
          u = false;
          d = false;
        }
        l = true;
        break;
      case 'U':
        if (d) {
          ctr++;
          l = false;
          r = false;
          d = false;
        }
        u = true;
        break;
      case 'D':
        if (u) {
          ctr++;
          l = false;
          u = false;
          r = false;
        }
        d = true;
    }
  }
  cout << ctr << endl;
  return 0;
}
