#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const double EPS = 1e-10;
const double PI = acos(-1);
class ADiagonalWalking {
 public:
  void solve(std::istream& in, std::ostream& out) {
    ios_base::sync_with_stdio(false);
    in.tie(nullptr), out.tie(nullptr);
    int N;
    string S;
    in >> N >> S;
    int ans = 0, len = 1;
    for (int i = (1); i < (N - 1 + 1); ++i) {
      if (S[i] != S[i - 1]) {
        ++len;
      } else {
        ans += (len + 1) / 2;
        len = 1;
      }
    }
    ans += (len + 1) / 2;
    out << ans << '\n';
  }
};
int main() {
  ADiagonalWalking solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
