#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const long long INF = 1LL << 60;
using vll = vector<long long>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pair<long long, long long> = pair<long long, long long>;
using vc = vector<char>;
using vvc = vector<vc>;
long long dx[4] = {0, 1, 0, -1};
long long dy[4] = {1, 0, -1, 0};
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long cu = 0;
  long long si = 0;
  long long k = 0;
  for (long long i = 0; i < ((int)(s).size()); i++) {
    if (k == 0 && s[i] == '#') {
      k = 1;
      si++;
    }
    if (k && s[i] == '.') {
      cu++;
    }
    if (k && s[i] == '#') {
      si++;
    }
  }
  long long ku = 0;
  for (int i = (int)(s).size() - 1; i >= 0; i--) {
    if (s[i] != '#') break;
    ku++;
  }
  cout << (min(si - ku, cu)) << endl;
}
