#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 10e6 + 1;
  for (int i = 0; i <= N; i++) {
    int n1 = 0, n2 = 0;
    for (int j = 0; j < i; j++) {
      if (S[j] == '#') n1++;
    }
    for (int j = i; j < N; j++) {
      if (S[j] == '.') n2++;
    }
    ans = min(ans, n1 + n2);
  }
  cout << ans << endl;
  return 0;
}
