#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int mod = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int white = 0, black = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black++;
    } else {
      white++;
    }
  }
  int ans = min(black, white);
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '.') {
      cnt = i;
    }
  }
  ans = min(ans, (cnt + 1) - white);
  cout << ans << endl;
  return 0;
}
