#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, l = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') l = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
  return x * l;
}
char s[105];
int dp[105][3];
int main() {
  int n = read();
  scanf("%s", s + 1);
  memset(dp, 127, sizeof(dp));
  if (s[1] == 'R')
    dp[1][0] = 1;
  else
    dp[1][1] = 1;
  for (int i = 2; i <= n; ++i)
    if (s[i] == 'R') {
      for (int j = 0; j <= 2; ++j) dp[i][0] = min(dp[i][0], dp[i - 1][j]);
      ++dp[i][0];
      dp[i][2] = dp[i - 1][1];
    } else {
      for (int j = 0; j <= 2; ++j) dp[i][1] = min(dp[i][1], dp[i - 1][j]);
      ++dp[i][1];
      dp[i][2] = dp[i - 1][0];
    }
  int ans = 105;
  for (int i = 0; i <= 2; ++i) ans = min(ans, dp[n][i]);
  printf("%d\n", ans);
  return 0;
}
