#include <bits/stdc++.h>
using namespace std;
int s1[19];
int main() {
  long long int n, c = 0, sum = 0, i, j, k;
  char r = 'R', l = 'L', u = 'U', d = 'D';
  string s;
  cin >> n;
  cin >> s;
  for (i = 0; i < n - 1; i++) {
    c = 0;
    if (s[i] == 'R') {
      s1['R' - 67] = 'L' - 67;
    } else if (s[i] == 'L') {
      s1['L' - 67] = 'R' - 67;
    } else if (s[i] == 'U') {
      s1['U' - 67] = 'D' - 67;
    } else {
      s1['D' - 67] = 'U' - 67;
    }
    for (j = 0; j <= 18; j++) {
      if (s[i + 1] - 67 == s1[j]) {
        sum++;
        c = 1;
        break;
      }
    }
    for (j = 0; j <= 18 && c == 1; j++) {
      s1[j] = 0;
    }
  }
  cout << sum + 1 << endl;
}
