#include <bits/stdc++.h>
using namespace std;
int n, pos0, pos1, num0 = 0, num1 = 0;
int a[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char x;
    cin >> x;
    if (x == '#')
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      pos0 = i;
      break;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (a[i] == 1) {
      pos1 = i;
      break;
    }
  }
  for (int i = pos0 + 1; i <= n; i++) {
    if (a[i] == 1) num0++;
  }
  for (int i = pos1 - 1; i >= 1; i--) {
    if (a[i] == 0) num1++;
  }
  cout << min(num0, num1) << endl;
  return 0;
}
