#include <bits/stdc++.h>
using namespace std;
void print(int n);
void next(int locate);
int main() {
  int n, cost = 1000000, tmp;
  string s;
  cin >> n >> s;
  int blk = 0, right;
  int w_all = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') w_all++;
  }
  if (w_all == 0 || w_all == n) {
    cout << 0;
    return 0;
  }
  right = w_all;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      right -= 1;
    else
      blk++;
    tmp = right + blk;
    if (cost > tmp) cost = tmp;
    if (i == n - 1 && w_all == 1 && s[i] == '.') {
      cout << 1;
      return 0;
    }
  }
  cout << cost;
  return 0;
}
