#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, j;
  string s;
  long long res = 0, white = 0;
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '.') white++;
    if ((i - white) > white) j = i;
  }
  for (int i = 1; i <= j; i++) {
    if (s[i] == '#') res++;
  }
  for (int i = j + 1; j <= n; j++) {
    if (s[i] == '.') res++;
  }
  cout << res << endl;
}
