#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int flag = 0;
  int black = 0, white = 0;
  for (int i = 0; i < n; i++) {
    if (flag == 1 && s[i] == '.') white++;
    if (flag == 1 && s[i] == '#') black++;
    if (flag == 0 && s[i] == '#') flag = 1, black++;
  }
  int blackm = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') break;
    if (s[i] == '#') blackm++;
  }
  black -= blackm;
  if (black > white)
    cout << white << endl;
  else
    cout << black << endl;
}
