#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, bl = 0, wh = 0;
  string s;
  char a;
  bool jg = true;
  cin >> n >> s;
  a = s[0];
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      bl++;
    else
      wh++;
  }
  if (bl > wh) {
    for (int i = 0; i < n; i++) {
      if (s[i] != '.') break;
      wh--;
    }
    cout << wh << endl;
  } else {
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] != '#') break;
      bl--;
    }
    cout << bl << endl;
  }
}
