#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 1000;
  for (int i = 1; i < N; i++) {
    int B = 0;
    int W = 0;
    if (S[i - 1] != S[i]) {
      for (int j = 0; j < i; j++) {
        if (S[j] == '#') B++;
      }
      for (int k = i; k < N; k++) {
        if (S[k] == '.') W++;
      }
      ans = min(ans, B + W);
    }
  }
  if (ans == 1000) ans = 0;
  cout << ans << endl;
}
