#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int ans = 2 * n;
  for (int i = 0; i < n + 1; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (j <= i - 1 && s[j] != '.') {
        count++;
      } else if (j > i - 1 && s[j] != '#') {
        count++;
      }
    }
    if (count < ans) {
      ans = count;
    }
  }
  cout << ans << endl;
}
