#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  string str;
  cin >> num;
  cin >> str;
  int ans = 0;
  int index = -1;
  int flag = 0;
  for (int i = str.size() - 1; i >= 0; i--) {
    if (flag == 0) {
      if (str[i] == '.') {
        ans++;
      } else {
        index = i;
        flag = 1;
      }
    } else {
      if (str[i] == '.') {
        break;
      } else {
        index = i;
      }
    }
  }
  if (index != -1) {
    for (int i = 0; i < index; i++) {
      if (str[i] == '#') {
        ans++;
      }
    }
  } else {
    ans = 0;
  }
  cout << ans << endl;
  return 0;
}
