#include <bits/stdc++.h>
using namespace std;
long long int A[5000001];
vector<long long int> v;
vector<pair<long long int, long long int> > v2;
int main() {
  long long int n, k, white = 0, black = 0, ans = 9999999999999999, nblack = 0,
                      nwhite = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#')
      black++;
    else
      white++;
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#')
      nblack++;
    else
      nwhite++;
    ans = min(ans, nblack + white - nwhite);
  }
  if (white == 0) ans = 0;
  cout << ans << endl;
  return 0;
}
