#include <bits/stdc++.h>
using namespace std;
long search(long l, string s, char c) {
  long n = s.size();
  long num = 0;
  for (long i = l; i < n; i++) {
    if (s[i] == c) {
      num++;
    }
  }
  return num;
}
long search_2(long l, string s, char c) {
  long n = s.size();
  long num = 0;
  for (long i = l; i >= 0; i--) {
    if (s[i] == c) {
      num++;
    }
  }
  return num;
}
long first(string s) {
  long n = s.size();
  long num = 0;
  long i = 0;
  while (i < n) {
    if (s[i] != '#') {
      i++;
    } else
      break;
  }
  return i;
}
long last(string s) {
  long n = s.size();
  long num = 0;
  long i = n - 1;
  while (i >= 0) {
    if (s[i] != '.') {
      i--;
    } else
      break;
  }
  return i;
}
int main() {
  long n, ans;
  string s;
  cin >> n >> s;
  long f = first(s);
  long l = last(s);
  long w = search(f, s, '.');
  long b = search_2(l, s, '#');
  ans = ((b) < (w) ? (b) : (w));
  cout << ans << endl;
}
