#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int cnt = 0;
  int ans = 1000000;
  for (int i = 0; i < N + 1; ++i) {
    cnt = 0;
    for (int j = 0; j < N; ++j) {
      if ((j < i) && (S.substr(j, 1) == "#")) {
        cnt++;
      } else if ((j >= i) && (S.substr(j, 1) == ".")) {
        cnt++;
      }
    }
    ans = min(cnt, ans);
  }
  cout << ans;
  return 0;
}
