#include <bits/stdc++.h>
using namespace std;
bool flagU = false, flagD = false, flagL = false, flagR = false;
void refresh() {
  flagD = false;
  flagU = false;
  flagL = false;
  flagR = false;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    switch (c) {
      case 'U':
        if (flagD) {
          refresh();
          flagU = true;
          ans++;
        }
        flagU = true;
        break;
      case 'D':
        if (flagU) {
          refresh();
          flagD = true;
          ans++;
        }
        flagD = true;
        break;
      case 'L':
        if (flagR) {
          refresh();
          flagL = true;
          ans++;
        }
        flagL = true;
        break;
      case 'R':
        if (flagL) {
          refresh();
          flagR = true;
          ans++;
        }
        flagR = true;
        break;
    }
  }
  ans++;
  cout << ans;
  return 0;
}
