#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int white = count(S.begin(), S.end(), '.');
  int black = 0;
  int ans = 10e6;
  for (int i = 1; i < N + 1; i++) {
    if (S[i - 1] == '#') {
      black++;
      ans = min(ans, white + 1);
    } else {
      white--;
      ans = min(ans, black + white);
    }
  }
  cout << ans << endl;
  return 0;
}
