#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, cnt;
  int flag = 0;
  string s;
  int ans = 0;
  cin >> n;
  cin >> s;
  for (size_t i = 0; i < n; i++) {
    if (s[i] == '#') {
      cnt = i;
      flag = 1;
      break;
    }
  }
  for (size_t i = 0; i < n; i++) {
    if (1 == flag && s[i] == '.' && i > cnt)
      ans++;
    else if (0 == flag && s[i] == '.')
      ans++;
  }
  cout << ans << endl;
  return 0;
}
