#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 cnt1 = 0;
  bool ok = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      cnt1++;
      ok = 1;
    } else if (ok && s[i + 1] == '.')
      cnt1++;
  }
  long long cnt2 = 0;
  long long last = -1;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '.') last = i;
  }
  for (int i = 0; i < (int)(last); i++) {
    if (s[i] == '#') cnt2++;
  }
  long long ans = min(cnt1, cnt2);
  cout << ans << endl;
}
