#include <bits/stdc++.h>
int main() {
  int n;
  int cnt = 0;
  int acnt = 0;
  int bcnt = 0;
  std::cin >> n;
  std::vector<char> v(n);
  for (int i = 0; i < n; i++) {
    std::cin >> v[i];
  }
  std::reverse(v.begin(), v.end());
  for (int i = 0; i < n;) {
    if (v[i] == '.') {
      if (v[i + 1] == '#') {
        cnt++;
        i = i + 2;
      } else {
        for (int j = i; j < n; ++j) {
          if (v[j] == '#') {
            acnt++;
          } else {
            bcnt++;
          }
        }
        break;
      }
    }
    i++;
  }
  cnt = cnt + std::min(acnt, bcnt);
  std::cout << cnt << std::endl;
  return 0;
}
