#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long INF = 1LL << 60;
using Graph = vector<vector<long long>>;
int main() {
  long long n;
  string s;
  cin >> n >> s;
  long long b = n;
  long long w = -1;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '#') {
      b = i;
      break;
    }
  }
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '.') w = i;
  }
  long long cnt1 = 0;
  long long cnt2 = 0;
  for (int i = b + 1; i < n; i++) {
    if (s[i] == '.') cnt1++;
  }
  for (int i = 0; i < w; i++) {
    if (s[i] == '#') cnt2++;
  }
  long long ans = min(cnt1, cnt2);
  cout << ans << endl;
}
