#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, ans = 0;
  string s;
  cin >> n >> s;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      a = i;
      break;
    }
  }
  for (long long i = n; i >= 0; i--) {
    if (s[i] == '#') {
      b = i;
      break;
    }
  }
  for (long long j = a; j < b + 1; j++) {
    if (s[j] == '.') ans++;
  }
  cout << ans + n - b - 1 << endl;
}
