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