#include <bits/stdc++.h>
using namespace std;
void debug(string S = "hello ! debug") {
  cout << S << endl;
  return;
}
template <class T>
void printVector(vector<T> &V) {
  cout << endl;
  for (int i = 0; i < V.size(); ++i) {
    cout << V[i] << " ";
  }
  cout << endl;
  return;
}
long long int sizeOfSt(long long int N) {
  long long int x = (long long int)(ceil(log2(N)));
  long long int max_size = 2 * (long long int)pow(2, x) - 1;
  return max_size;
}
template <class T>
T maximumFromVector(vector<T> &V) {
  T ans = V[0];
  for (int i = 1; i < V.size(); ++i) {
    ans = max(ans, V[i]);
  }
  return ans;
}
template <class T>
T minimumFromVector(vector<T> &V) {
  T ans = V[0];
  for (int i = 1; i < V.size(); ++i) {
    ans = min(ans, V[i]);
  }
  return ans;
}
template <class T>
T vectorSum(vector<T> &V) {
  T sum = 0;
  for (long long int i = 0; i < V.size(); ++i) {
    sum += V[i];
  }
  return sum;
}
int main() {
  long long int n;
  scanf("%lld", &n);
  string S;
  cin >> S;
  long long int ans = S.length();
  for (long long int i = 0; i < S.length() - 1; ++i) {
    if (S[i] != S[i + 1]) {
      --ans;
      ++i;
    }
  }
  cout << ans;
  return 0;
}
