#include <bits/stdc++.h>
using namespace std;
int dy[4] = {1, 0, -1, 0}, dx[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  string s;
  cin >> n >> s;
  long long b = 0, w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      w++;
    } else {
      b++;
    }
  }
  long long noB = 0, noW = 0;
  int i = n - 1;
  while (s[i] == '#') {
    noB++;
    i--;
  }
  i = 0;
  while (s[i] == '.') {
    noW++;
    i++;
  }
  cout << min(b - noB, w - noW) << '\n';
  return 0;
}
