#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int lr = 0, du = 0;
  int n;
  cin >> n;
  long long ans = 1;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    switch (c) {
      case 'L':
        if (!lr)
          lr = 1;
        else if (lr == 2) {
          lr = 1;
          du = 0;
          ans++;
        }
        break;
      case 'R':
        if (!lr)
          lr = 2;
        else if (lr == 1) {
          lr = 2;
          du = 0;
          ans++;
        }
        break;
      case 'D':
        if (!du)
          du = 1;
        else if (du == 2) {
          du = 1;
          lr = 0;
          ans++;
        }
        break;
      case 'U':
        if (!du)
          du = 2;
        else if (du == 1) {
          du = 2;
          lr = 0;
          ans++;
        }
        break;
    }
  }
  cout << ans;
  return 0;
}
