#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;
  int count1 = 0, count2 = 0;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    if (c == '.') count1++;
    s += c;
  }
  if (count1 == n) {
    cout << 0 << endl;
    return 0;
  }
  int ans = MOD;
  for (int i = 0; i < n; ++i) {
    ans = min(count1 + count2, ans);
    if (s[i] == '.') count1--;
    if (s[i] == '#') count2++;
    cerr << ans << endl;
  }
  cout << ans << endl;
  return 0;
}
