#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int wNum = count(S.begin(), S.end(), '.');
  int bCnt = 0, wCnt = wNum;
  int min = INT_MAX;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') bCnt++;
    if (S[i] == '.') wCnt--;
    if (bCnt + wCnt < min) min = bCnt + wCnt;
  }
  cout << min << endl;
}
