#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
std::pair<T, U> operator+(const std::pair<T, U> &l, const std::pair<T, U> &r) {
  return {l.first + r.first, l.second + r.second};
}
typedef void (*callback_function)(void);
const long long INF64 = 1e18;
const long long INF32 = 1e9;
long long dist(pair<long long, long long> &a, pair<long long, long long> &b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
long long dist(pair<long long, long long> &a) {
  return abs(a.first) + abs(a.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  {
    long long n;
    string s;
    cin >> n >> s;
    long long res = 1;
    bool first[2] = {true, true};
    char hv[2];
    string HV[2] = {"LR", "DU"};
    for (long long i = (0); i < (s.length()); i++) {
      for (long long j = (0); j < (2); j++) {
        if (HV[j].find(s[i]) != string::npos) {
          if (first[j]) {
            first[j] = false;
            hv[j] = s[i];
          } else if (hv[j] != s[i]) {
            first[1 - j] = true;
            res++;
            hv[j] = s[i];
          }
          break;
        }
      }
    }
    cout << res << endl;
  }
  return 0;
}
