#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long first = 0, last = n - 1;
  for (long long i = 0; i < n; i++) {
    first = i;
    if (s[i] == '#') break;
  }
  for (long long i = n - 1; i >= 0; i--) {
    last = i;
    if (s[i] == '.') break;
  }
  long long h = 0, d = 0;
  for (long long i = first; i <= last; i++) {
    if (s[i] == '#')
      h++;
    else
      d++;
  }
  cout << min(h, d) << endl;
}
signed main() {
  long long n = 1;
  while (n--) solve();
  return 0;
}
