#include <bits/stdc++.h>
using namespace std;
int n, a, b = 9999999;
bool fg1 = false, fg2 = false;
char s[200020];
int main() {
  cin >> n >> s;
  for (int i = 0; i < strlen(s); i++) {
    a = 0;
    for (int j = 0; j < strlen(s); j++) {
      if (j < i && s[j] == '#' || j > i && s[j] == '.') a++;
    }
    b = min(a, b);
  }
  cout << b;
  return 0;
}
