#include <bits/stdc++.h>
using namespace std;
const long long int mxN = 1e5 + 5;
const long long int MOD = 1e9 + 7;
long long int one = 0;
long long int ceil1(long long int a, long long int b) {
  if (a % b == 0)
    return (a / b);
  else
    return ((a / b) + 1);
}
unordered_map<long long int, long long int> make_pair;
vector<long long int> a(mxN, 0);
bool vis = false;
void solve() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  long long int cnt = 1;
  char prev = '1';
  char prev2 = '2';
  for (long long int i = 0; i < (long long int)s.length(); i++) {
    if (s[i] == 'U' || s[i] == 'D') {
      if (prev2 == '2')
        prev2 = s[i];
      else if (s[i] != prev2) {
        prev2 = s[i], cnt++;
        prev = '1';
      }
    } else if (s[i] == 'R' || s[i] == 'L') {
      if (prev == '1')
        prev = s[i];
      else if (s[i] != prev) {
        cnt++, prev = s[i];
        prev2 = '2';
      }
    }
  }
  cout << cnt << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    one++;
    solve();
  }
  return 0;
}
