#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
const int INF = 0x3f3f3f3f;
int vis[100];
bool check(char a) {
  if (a == 'L' && vis['R'] == 1) return 1;
  if (a == 'R' && vis['L'] == 1) return 1;
  if (a == 'U' && vis['D'] == 1) return 1;
  if (a == 'D' && vis['U'] == 1) return 1;
  return 0;
}
int main() {
  int n;
  int ans = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (check(s[i])) {
      memset(vis, 0, sizeof(vis));
      ans++;
    }
    vis[s[i]] = 1;
  }
  cout << ans + 1 << endl;
}
