#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int i, j, k, n, m, l, f, x, y, z;
  cin >> n >> s;
  int sum1 = 0;
  int sum2 = 0;
  bool ok1 = false;
  bool ok2 = false;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') ok1 = true;
    if (s[i] == '.' && ok1) sum1++;
    if (s[n - 1 - i] == '.') ok2 = true;
    if (s[n - 1 - i] == '#' && ok2) sum2++;
  }
  sum1 = min(sum1, sum2);
  cout << sum1;
}
