#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m = 0, max = n, b = 0, w = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < (n); ++i) {
    if (s[i] - '#' == 0 && i < max)
      max = i;
    else if (s[i] - '.' == 0 && i > m)
      m = i;
  }
  for (int i = 0; i < (n); ++i) {
    if (s[i] - '#' == 0 && i <= m)
      b++;
    else if (s[i] - '.' == 0 && i >= max)
      w++;
  }
  cout << min(b, w) << endl;
}
