#include <bits/stdc++.h>
using namespace std;
long long int n, x, y, z, w, s, cnt;
int main() {
  cin >> n;
  string p;
  cin >> p;
  for (int i = 0; i < n; i++) {
    s++;
    int r = x, t = y;
    if (p[i] == 'R') {
      x++;
    } else if (p[i] == 'L') {
      x--;
    } else if (p[i] == 'D') {
      y--;
    } else if (p[i] == 'U') {
      y++;
    }
    if (s > abs(z - x) + abs(w - y)) {
      z = r;
      w = t;
      cnt++;
      s = 1;
    }
  }
  cnt++;
  cout << cnt;
}
