#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int left;
  int right;
  vector<int> res(N + 1, 0);
  for (int i = 0; i <= N; i++) {
    if (i == 0) {
      left = 0;
      right = count(S.begin(), S.end(), '#');
    } else if (i == N) {
      left = count(S.begin(), S.end(), '.');
      right = 0;
    } else {
      left = count(S.begin(), S.begin() + i, '#');
      right = count(S.begin() + i, S.end(), '.');
    }
    res.at(i) = left + right;
  }
  cout << *min_element(res.begin(), res.end()) << endl;
}
