#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  string a;
  cin >> a;
  map<char, int> cnt;
  int ans = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == 'R') {
      if (cnt['L'] == 0)
        cnt['R']++;
      else {
        cnt['L'] = 0;
        cnt['U'] = 0;
        cnt['D'] = 0;
        ans++;
        cnt['R']++;
      }
    } else if (a[i] == 'L') {
      if (cnt['R'] == 0)
        cnt['L']++;
      else {
        cnt['R'] = 0;
        cnt['U'] = 0;
        cnt['D'] = 0;
        ans++;
        cnt['L']++;
      }
    } else if (a[i] == 'U') {
      if (cnt['D'] == 0)
        cnt['U']++;
      else {
        cnt['D'] = 0;
        cnt['R'] = 0;
        cnt['L'] = 0;
        ans++;
        cnt['U']++;
      }
    } else if (a[i] == 'D') {
      if (cnt['U'] == 0)
        cnt['D']++;
      else {
        cnt['U'] = 0;
        cnt['R'] = 0;
        cnt['L'] = 0;
        ans++;
        cnt['D']++;
      }
    }
  }
  cout << ans;
  return 0;
}
