#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string S;
  cin >> S;
  string T = S;
  int l = 0;
  int r = count((S).begin(), (S).end(), '.');
  int ans = r;
  for (int i = 0; i < (n); ++i) {
    if (S[i] == '#') {
      l++;
    } else {
      r--;
    }
    ans = min(ans, r + 1);
  }
  cout << (ans) << endl;
  return 0;
}
