#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, int> > > g;
vector<int> visited;
priority_queue<pair<int, int> > pq;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long a = 0, b = 0, c = 0, d = 0;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'R') a++;
    if (s[i] == 'L') b++;
    if (s[i] == 'U') c++;
    if (s[i] == 'D') d++;
    if (d != 0 && c != 0) {
      ans++;
      d = 0, c = 0;
      if (s[i] == 'D')
        d++;
      else
        c++;
      a = 0;
      b = 0;
      continue;
    }
    if (a != 0 && b != 0) {
      ans++;
      a = 0, b = 0;
      if (s[i] == 'R')
        a++;
      else
        b++;
      c = 0;
      d = 0;
      continue;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
