#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> dp(s.length() + 1, 0);
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == '.')
      dp[i] = dp[i + 1] + 1;
    else
      dp[i] = dp[i + 1];
  }
  long long ans = INT_MAX, cnt = 0;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '#') {
      ans = min(cnt + dp[i], ans);
      cnt++;
    }
  }
  if (cnt == 0)
    cout << 0;
  else
    cout << ans;
}
