#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;
  bool black = false;
  int whitenum = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') black = true;
    if (black && S[i] == '.') whitenum++;
  }
  reverse(S.begin(), S.end());
  bool white = false;
  int blacknum = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') white = true;
    if (white && S[i] == '#') blacknum++;
  }
  int ans = min(whitenum, blacknum);
  cout << ans << "\n";
}
