#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;
  int firstb;
  bool flagb = true;
  int cntw = 0;
  int cntb = 1;
  int last = 0;
  for (int i = (0); i < (n); i++) {
    if (s[i] == '#' && flagb) {
      firstb = i;
      flagb = false;
    } else if (s[i] == '.' && flagb == false)
      cntw++;
    else if (s[i] == '#' && flagb == false)
      cntb++;
    if (s[i] == '#') {
      last++;
    } else if (s[i] == '.')
      last = 0;
  }
  if ((cntb - last) < cntw)
    cout << (cntb - last) << endl;
  else
    cout << (cntw) << endl;
  return 0;
}
