#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long INF = 10000000000000000;
double PI = 3.1415926535;
long long ceiling(long long a, long long b) {
  if (a % b == 0) {
    return a / b;
  } else {
    return (a / b) + 1;
  }
}
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
using Graph = vector<vector<long long>>;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0, ans2 = 0;
  vector<int> A(1, 1);
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == S[i + 1])
      A.back()++;
    else
      A.push_back(1);
  }
  if (S[0] == '#') {
    for (int i = 0; i < A.size(); i++) {
      if (i % 2 == 1) ans += A[i];
      if (i % 2 == 0 && i != A.size() - 1) {
        ans2 += A[i];
      }
    }
  } else {
    for (int i = 2; i < A.size(); i++) {
      if (i % 2 == 0) ans += A[i];
      if (i % 2 == 1 && i != A.size() - 1) {
        ans2 += A[i];
      }
    }
  }
  cout << min(ans, ans2) << endl;
}
