#include <bits/stdc++.h>
using namespace std;
long long N, M, K;
string s1, s2;
map<char, char> h, hr;
int main() {
  cin >> N;
  cin >> s1;
  hr['R'] = 'L';
  hr['L'] = 'R';
  hr['U'] = 'D';
  hr['D'] = 'U';
  int ret = 1;
  for (auto x : s1) {
    if (h[hr[x]]) {
      ++ret;
      h.clear();
      h[x] = 1;
    } else {
      h[x] = 1;
    }
  }
  cout << ret << endl;
}
