#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << setprecision(10);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int left[n], right[n + 1];
  right[n] = 0;
  int till = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      till++;
    }
    left[i] = till;
  }
  till = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      till++;
    }
    right[i] = till;
  }
  int ans = INT_MAX;
  for (int i = 0; i < n; i++) {
    ans = min(ans, left[i] + right[i + 1]);
  }
  cout << ans;
}
