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