#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
char s[maxn];
int vis[5];
map<int, char> mp;
int main() {
  int n;
  mp['R'] = 1;
  mp['U'] = 2;
  mp['L'] = 3;
  mp['D'] = 4;
  while (~scanf("%d%s", &n, s)) {
    memset(vis, 0, sizeof(vis));
    int ans = 1;
    bool flag = true;
    for (int i = 0; i < n; i++) {
      if (!vis[mp[s[i]]]) {
        vis[mp[s[i]]] = 1;
        if (vis[1] + vis[2] + vis[3] + vis[4] > 2 ||
            ((vis[1] + vis[2] + vis[3] + vis[4] == 2) &&
             (vis[1] * mp['R'] + mp['U'] * vis[2] + mp['L'] * vis[3] +
              mp['D'] * vis[4]) %
                     2 ==
                 0)) {
          memset(vis, 0, sizeof(vis));
          vis[mp[s[i]]] = 1;
          ans++;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
