#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int X = 0, Y = N, Z = 0;
  for (int i = 0; i < (S.size()); i++) {
    if (S[i] == '.')
      X++;
    else if (Y == N)
      Y = i;
  }
  int A = 0, B = N;
  for (int i = 0; i < (S.size()); i++) {
    if (S[N - 1 - i] == '#')
      A++;
    else if (B == N)
      B = i;
  }
  cout << min(X - Y, A - B) << endl;
}
