#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0, up = 0, right = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R') {
      if (right == 0) {
        right = 1;
      } else if (right == 2) {
        cnt += 1;
        right = 1;
        up = 0;
      }
    } else if (s[i] == 'L') {
      if (right == 0) {
        right = 2;
      } else if (right == 1) {
        cnt += 1;
        right = 2;
        up = 0;
      }
    } else if (s[i] == 'U') {
      if (up == 0) {
        up = 1;
      } else if (up == 2) {
        cnt += 1;
        up = 1;
        right = 0;
      }
    } else if (s[i] == 'D') {
      if (up == 0) {
        up = 2;
      } else if (up == 1) {
        cnt += 1;
        up = 2;
        right = 0;
      }
    }
  }
  cout << cnt + 1 << endl;
  return 0;
}
