#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, ans = 200000, l = 0, r = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++)
      if (s[j] == '.') l++;
    for (int k = i + 1; k < n; k++)
      if (s[k] == '#') r++;
    ans = min(ans, l + r);
  }
  cout << ans;
}
