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