#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;
int main() {
  int N;
  string S;
  cin >> N >> S;
  string S2 = S;
  int ans1 = 0;
  for (int i = N - 2; i >= 0; --i) {
    if (S[i + 1] == '.' && S[i] == '#') {
      S[i] = '.';
      ++ans1;
    }
  }
  int ans2 = 0;
  for (int i = N - 2; i >= 0; --i) {
    if (S2[i + 1] == '.' && S2[i] == '#') {
      S2[i + 1] = '#';
      ++ans2;
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
