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