#include <bits/stdc++.h>
using namespace std;
int nod(int a, int b) { return a ? nod(b % a, a) : b; }
int nok(int a, int b) { return a / nod(a, b) * b; }
string intToStr(long long n) {
  return n ? intToStr(n / 10) + (char)('0' + n % 10) : "";
}
long long sum(vector<int> v) {
  long long ans = 0;
  for (int i = 0; i < v.size(); i++) ans += v[i];
  return ans;
}
long long sum(vector<long long> v) {
  long long ans = 0;
  for (int i = 0; i < v.size(); i++) ans += v[i];
  return ans;
}
bool prime(int n) {
  if (n == 1) return false;
  for (int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
bool letter(char c) { return 'a' <= c && c <= 'z'; }
bool LETTER(char c) { return 'A' <= c && c <= 'Z'; }
bool digit(char c) { return ('0' <= c && c <= '9'); }
const long double pi = 3.141592653589793238462643383279;
const long double eps = 1e-8;
const long double zero = 0;
const long long null = 0;
const long long INF = 1e18;
const long long MOD = 1000000007;
const int BIG = 1e9;
const int ALF = 26;
const int MAXN = 200001;
const int MAXM = 1001;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const string alphabet = "abcdefghijklmnopqrstuvwxyz";
const string ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int a[26];
vector<pair<int, int> > b;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  int y = 0, x = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'U') {
      if (y == -1) {
        ans++;
        x = 0;
      }
      y = 1;
    }
    if (s[i] == 'D') {
      if (y == 1) {
        ans++;
        x = 0;
      }
      y = -1;
    }
    if (s[i] == 'R') {
      if (x == -1) {
        ans++;
        y = 0;
      }
      x = 1;
    }
    if (s[i] == 'L') {
      if (x == 1) {
        ans++;
        y = 0;
      }
      x = -1;
    }
  }
  if (x != 0 || y != 0) ans++;
  cout << ans;
  return 0;
}
