#include <bits/stdc++.h>
using namespace std;
const long long mo = 1000000007;
long long ans = 9999999;
long long dp[0][0];
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long bl = 0;
  long long ren = 0;
  long long ten = 0;
  bool a = 0;
  for (long long i = 0; i < (long long)(n); i++) {
    if (s[i] != '#') ten++;
  }
  long long nowten = 0;
  long long temp;
  for (long long i = 0; i < (long long)(n - 1); i++) {
    if (s[i] != '#') nowten++;
    if (s[i] == '#') {
      ren++;
      bl++;
    }
    if (s[i] == '#' && s[i + 1] != '#') {
      temp = ten - nowten + bl - ren;
      if (ans > temp) {
        ans = temp;
      }
      ren = 0;
    }
  }
  if (ans == 9999999) ans = 0;
  cout << ans << endl;
  return 0;
}
