#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a = 1;
  string s;
  cin >> n >> s;
  set<char> p;
  map<char, char> m{{'R', 'L'}, {'L', 'R'}, {'U', 'D'}, {'D', 'U'}};
  for (auto& i : s) {
    if (p.count(m[i])) {
      p.clear();
      ++a;
    }
    p.insert(i);
  }
  cout << a << "\n";
}
