#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  int count1 = 0, count2 = 0;
  bool a = false, b = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') b = true;
    if (b && s[i] == '.') count1++;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') a = true;
    if (a && s[i] != '#') count2++;
  }
  cout << min(count1, count2) << endl;
}
