#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int x, y;
  for (int i = 0; i < n; i++)
    if (s[i] == '#') {
      x = i;
      break;
    }
  for (int i = n - 1; i >= 0; i--)
    if (s[i] == '.') {
      y = i;
      break;
    }
  int a = 0, b = 0;
  for (int i = x; i < n; i++)
    if (s[i] == '.') a++;
  for (int i = 0; i <= y; i++)
    if (s[i] == '#') b++;
  cout << min(a, b);
}
