#include <bits/stdc++.h>
using namespace std;
int dist(int sx, int sy, int fx, int fy) { return abs(sx - fx) + abs(sy - fy); }
int main() {
  int n, curX = 0, curY = 0, so_far = 0, newX = 0, newY = 0, ans = 0;
  string str;
  cin >> n >> str;
  for (int i = 0; i < n; i++) {
    if (str[i] == 'R') newX++;
    if (str[i] == 'L') newX--;
    if (str[i] == 'D') newY--;
    if (str[i] == 'U') newY++;
    so_far++;
    if (dist(curX, curY, newX, newY) == so_far) continue;
    so_far = 1;
    curX = newX;
    curY = newY;
    if (str[i] == 'R') curX--;
    if (str[i] == 'L') curX++;
    if (str[i] == 'D') curY++;
    if (str[i] == 'U') curY--;
    ans++;
  }
  cout << ans + 1 << endl;
  return 0;
}
