#include <bits/stdc++.h>
using namespace std;
int n, ans, sum;
string s;
bool y;
int main() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') y = true;
    if (y and s[i] == '.') ans++;
  }
  y = false;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '.') y = true;
    if (y and s[i] == '#') sum++;
  }
  cout << min(ans, sum);
  return 0;
}
