#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, res = 0, res2 = 0;
  string S, T;
  cin >> N;
  cin >> S;
  T = S;
  for (int i = N - 2; i >= 0; i--) {
    if (S[i] == '#' && S[i + 1] == '.') {
      S[i] = '.';
      res++;
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (T[i] == '#' && T[i + 1] == '.') {
      T[i + 1] = '#';
      res2++;
    }
  }
  cout << min(res, res2);
  return 0;
}
