#include <bits/stdc++.h>
using namespace std;
long long dp[50][2] = {0};
int main(void) {
  long long n;
  string s;
  cin >> n >> s;
  long long num = 0, ans = 0;
  if (s[n - 1] == '#') {
    long long i = 0;
    for (i = 0; i < n - 1; i++) {
      if (s[i] == '#') break;
    }
    for (long long k = i; k < n - 1; k++) {
      if (s[k] == '.') num++;
    }
    cout << min(n - 1 - i - num, num) << endl;
  } else {
    long long i = 0;
    for (i = 0; i < n; i++) {
      if (s[i] == '#') break;
    }
    for (long long k = i; k < n; k++) {
      if (s[k] == '.') num++;
    }
    cout << min(n - i - num, num) << endl;
  }
}
