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