#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  string a;
  cin >> a;
  int b[2];
  b[0] = 0;
  b[1] = 0;
  int p = 0;
  for (int i = 0; i < a.length(); i++) {
    int c;
    int d;
    if (a[i] == 'L') {
      c = 0;
      d = -1;
    }
    if (a[i] == 'R') {
      c = 0;
      d = 1;
    }
    if (a[i] == 'D') {
      c = 1;
      d = -1;
    }
    if (a[i] == 'U') {
      c = 1;
      d = 1;
    }
    if (b[c] == 0)
      b[c] = d;
    else {
      if (b[c] != d) {
        b[0] = 0;
        b[1] = 0;
        b[c] = d;
        p++;
      }
    }
  }
  cout << p + 1;
}
