#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  ;
  int n, i;
  cin >> n;
  string s;
  cin >> s;
  int f = 0, ans1 = 0, ans2 = 0;
  for (i = 0; i < n; i++) {
    if (f == 0) {
      if (s[i] == '#') f = 1;
    } else if (s[i] == '.')
      ans1++;
  }
  for (i = n - 1; i >= 0; i--) {
    if (f == 0) {
      if (s[i] == '.') f = 1;
    } else if (s[i] == '#')
      ans2++;
  }
  cout << min(ans1, ans2) << '\n';
}
