#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  int k = n;
  for (int i = 0; i < n; ++i)
    if (s[i] == '.') ans++;
  for (int i = 0; i < n; ++i) {
    int f = ans;
    if (s[i] == '#') f++;
    if (s[i] == '.') f--;
    ans = f;
    k = min(ans, k);
  }
  cout << k << endl;
  return 0;
}
