#include <bits/stdc++.h>
using namespace std;
const long int MOD = pow(10, 9) + 7;
int main() {
  int n;
  cin >> n;
  string s;
  char c;
  long int count1 = 0, count2 = 0;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    if (c == '.') count1++;
    s += c;
  }
  if (count1 == n || count1 == 0) {
    cout << 0 << endl;
  } else {
    long int ans = MOD;
    for (int i = 0; i < n; ++i) {
      if (s[i] == '.') count1--;
      if (s[i] == '#') count2++;
      ans = min(count1 + count2, ans);
    }
    cout << ans << endl;
  }
  return 0;
}
