#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long right = n - 1, left = 0;
  long long start = int((right + left) / 2);
  if (s[start] == '.') {
    while (start < right && s[start] == '.') start++;
  } else {
    while (start < right && s[start] == '#') start--;
  }
  long long ans = 0;
  long long temp = start;
  while (temp <= right) {
    if (s[temp] == '.') ans++;
    temp++;
  }
  temp = start;
  while (temp >= left) {
    if (s[temp] == '#') ans++;
    temp--;
  }
  cout << ans - 1 << endl;
}
