#include <bits/stdc++.h>
using namespace std;
static const long long maxLL = (long long)1 << 62;
const long long MOD = 1000000007;
const long long INF = 1e18;
int ca[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
signed main() {
  int n;
  string s;
  cin >> n >> s;
  int black = 0, white = 0;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == '.') {
      white++;
    } else {
      black++;
    }
  }
  if (black > white) {
    cout << white << endl;
  } else {
    bool flag = false;
    for (int i = s.length() - 1; i >= 0; i--) {
      if (flag == false && s[i] == '#') {
        black--;
      } else {
        flag = true;
      }
    }
    cout << black << endl;
  }
  getchar();
  getchar();
  return 0;
}
