#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long ans = 0;
  long long cnt = 0;
  bool prev = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.' && !prev) {
      continue;
    } else if (s[i] == '#' && !prev) {
      prev = true;
    } else if (s[i] == '.' && prev) {
      cnt++;
      prev = true;
    } else if (s[i] == '#' && prev) {
      prev = true;
    }
  }
  ans = cnt;
  cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') cnt++;
  }
  ans = min(ans, cnt);
  cout << ans << endl;
  ;
}
