#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 1;
  bool flL = false;
  bool flR = false;
  bool flU = false;
  bool flD = false;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'R') {
      if (!flL && !flR) {
        flR = true;
      } else if (flL && !flR) {
        flL = false;
        flR = true;
        flD = false;
        flU = false;
        count++;
      }
    } else if (s[i] == 'L') {
      if (!flL && !flR) {
        flL = true;
      } else if (!flL && flR) {
        flR = false;
        flL = true;
        flU = false;
        flD = false;
        count++;
      }
    } else if (s[i] == 'D') {
      if (!flD && !flU) {
        flD = true;
      } else if (flU && !flD) {
        flU = false;
        flD = true;
        flL = false;
        flR = false;
        count++;
      }
    } else if (s[i] == 'U') {
      if (!flD && !flU) {
        flU = true;
      } else if (!flU && flD) {
        flU = true;
        flD = false;
        flR = false;
        flL = false;
        count++;
      }
    }
  }
  cout << count;
  return 0;
}
