#include <bits/stdc++.h>
using namespace std;
char x[2 * 100001];
int n, ans;
int xState = -1, yState = -1;
bool incY, incX;
int main() {
  scanf("%d%s", &n, x);
  for (int i = 0; i < n; i++) {
    if (x[i] == 'R' && xState == -1)
      xState = 1;
    else if (x[i] == 'L' && xState == -1)
      xState = 0;
    else if (x[i] == 'U' && yState == -1)
      yState = 1;
    else if (x[i] == 'D' && yState == -1)
      yState = 0;
    else if (x[i] == 'L' && xState || x[i] == 'R' && !xState) {
      ans++;
      xState ^= 1;
      yState = -1;
    } else if (x[i] == 'D' && yState || x[i] == 'U' && !yState) {
      ans++, incY = 1;
      yState ^= 1;
      xState = -1;
    }
  }
  printf("%d", ans + 1);
}
