#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int whiteCount = 0;
  int blackCount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      blackCount++;
    } else if (S[i] == '.') {
      whiteCount++;
    }
  }
  int minCount = INT32_MAX;
  int currentWhiteCount = whiteCount;
  int currentBlackCount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      currentBlackCount++;
    } else if (S[i] == '.') {
      currentWhiteCount--;
    }
    minCount = min(minCount, (currentWhiteCount + currentBlackCount));
  }
  cout << minCount << endl;
  return 0;
}
