#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long l = 0, r = 0;
  for (long long i = (0); i < (long long)(N); i++) {
    if (S[i] == '.')
      l++;
    else
      break;
  }
  for (long long i = N - 1; i >= 0; i--) {
    if (S[i] == '#')
      r++;
    else
      break;
  }
  long long b = 0, w = 0;
  for (long long i = (0); i < (long long)(N); i++) {
    if (S[i] == '#')
      b++;
    else
      w++;
  }
  long long ans = min(b - r, w - l);
  cout << ans << endl;
  return 0;
}
