#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N;
  string S;
  cin >> N >> S;
  int left_white = -1, right_black = -1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      right_black = i;
    else if (left_white == -1)
      left_white = i;
  }
  int reverse_count = 0;
  for (int i = 0; i < left_white; i++) {
    if (S[i] == '#') reverse_count++;
  }
  if (right_black != -1) {
    for (int i = right_black; i < N; i++) {
      if (S[i] == '.') reverse_count++;
    }
  }
  cout << reverse_count << endl;
}
