#include <bits/stdc++.h>
using namespace std;
string a;
int main() {
  int n;
  cin >> n;
  cin >> a;
  int lenl = n - 1, lenr = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] != '.') {
      lenl = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] != '#') {
      lenr = i;
      break;
    }
  }
  int ans1 = 0, ans2 = 0;
  for (int i = lenl; i <= lenr; i++) {
    if (a[i] == '#')
      ans1++;
    else
      ans2++;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
