#include <bits/stdc++.h>
using namespace std;
const long long INFL = 1e18;
const int INF = 1001001001;
const int mod = 1000000007;
int main() {
  string s;
  int n;
  cin >> n >> s;
  int ans = 0;
  bool f = false;
  for (int i = 0; i < (n - 1); i++) {
    if (s[i] == '#') ans++;
  }
  int sum = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '#') f = true;
    if (s[i] == '.' && f) sum++;
  }
  cout << min(ans, sum) << endl;
}
