#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 99999999;
  string tmp = "#.";
  int right = 0;
  int left = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == tmp[1]) right++;
  }
  for (int i = 0; i < (int)(n); i++) {
    if (ans > left + right) ans = left + right;
    if (s[i] == tmp[0]) {
      left++;
    } else {
      right--;
    }
  }
  cout << ans << endl;
}
