#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, f = 0, ans = 0, w = 0, b = 0, gb = 0, alb = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == '.') {
      f = i;
      break;
    }
  for (int i = f; i < n; i++) {
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  bool flag = true;
  if (s[n - 1] == '#') true;
  for (int i = n - 1; i > -1; i--) {
    if (flag = true && s[i] == '#') {
      gb++;
    } else {
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') alb++;
  }
  ans = alb - gb;
  if (b == 0)
    cout << "0" << endl;
  else {
    if (w < ans)
      cout << w << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
