#include <bits/stdc++.h>
using namespace std;
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
int main() {
  int n, count = 0, count2 = 0, count3 = 0, flag = 0, count4 = 0, count5;
  string s;
  cin >> n >> s;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '.') count++;
  }
  count = min(count, n - count);
  for (long long int i = n - 1; i >= 0; i--) {
    if (s[i] == '#' && flag == 0) {
      count2++;
    } else if (flag == 1 && s[i] == '#') {
      count3++;
      count5 = count4;
    } else {
      flag = 1;
      count4++;
    }
  }
  count3 = min(count3, count5);
  cout << min(count, count3) << endl;
}
