#include <bits/stdc++.h>
using namespace std;
int n;
string str;
int main() {
  cin >> n >> str;
  int x = 0, y = 0;
  int tx = 0, ty = 0;
  int mx = 0, my = 0;
  int ss = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    mx = x;
    my = y;
    if (str[i] == 'R')
      x += 1;
    else if (str[i] == 'L')
      x -= 1;
    else if (str[i] == 'U')
      y += 1;
    else
      y -= 1;
    ss++;
    if (abs(x - tx) + abs(y - ty) < ss) {
      tx = mx;
      ty = my;
      ans++;
      ss = 0;
    }
  }
  ans++;
  cout << ans << endl;
}
