#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 10;
long long N;
char str[maxn];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  cin >> str + 1;
  bool flag[5];
  memset(flag, 0, sizeof(flag));
  long long ans = 0;
  for (register long long i = 1; i <= N; ++i) {
    if (str[i] == 'L') {
      if (flag[2]) {
        ++ans;
        memset(flag, 0, sizeof(flag));
      }
      flag[1] = true;
    } else if (str[i] == 'R') {
      if (flag[1]) {
        ++ans;
        memset(flag, 0, sizeof(flag));
      }
      flag[2] = true;
    } else if (str[i] == 'D') {
      if (flag[3]) {
        ++ans;
        memset(flag, 0, sizeof(flag));
      }
      flag[4] = true;
    } else {
      if (flag[4]) {
        ++ans;
        memset(flag, 0, sizeof(flag));
      }
      flag[3] = true;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
