#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
int main() {
  long long i, j, k, l, m, n;
  string s;
  cin >> n;
  cin >> s;
  string temp = "";
  long long fl = 0;
  for (i = 0; i < s.length(); i++) {
    if ((s[i] == '.') && (fl == 0))
      continue;
    else {
      fl = 1;
      temp += s[i];
    }
  }
  j = temp.length() - 1;
  if (fl == 0) {
    cout << 0;
    return 0;
  }
  while (temp[j] == '#') j--;
  j++;
  long long cnta = 0, cntb = 0;
  for (i = 0; i < j; i++) {
    if (temp[i] == '#')
      cnta++;
    else
      cntb++;
  }
  cout << min(cnta, cntb);
}
