#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n, count = 1;
  string s;
  cin >> n >> s;
  char a = '0', b = '0';
  for (int i = 0; i < n; i++) {
    if (a == '0') {
      a = s[i];
    } else if (b == '0' && s[i] != a) {
      b = s[i];
    } else if (s[i] != a && s[i] != b) {
      count++;
      a = s[i];
      b = '0';
    }
    if ((a == 'R' && b == 'L') || (a == 'L' && b == 'R') ||
        (a == 'U' && b == 'D') || (a == 'D' && b == 'U')) {
      count++;
      a = b;
      b = '0';
    }
  }
  cout << count;
}
