#include <bits/stdc++.h>
using namespace std;
map<char, char> opp;
map<char, int> vis;
void doit() {
  for (char x = 'A'; x <= 'Z'; ++x) vis[x] = 0;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sol = 0;
  opp['U'] = 'D';
  opp[opp['U']] = 'U';
  opp['L'] = 'R';
  opp[opp['L']] = 'L';
  for (int i = 0; i < s.length(); ++i) {
    if (vis[opp[s[i]]]) {
      sol++;
      vis[opp[s[i]]] = 0;
      doit();
    }
    vis[s[i]] = 1;
  }
  cout << sol + 1 << endl;
  return 0;
}
