#include <bits/stdc++.h>
using namespace std;
int bitCount(uint32_t bits) {
  bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
  bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
  bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
  bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
  return (bits & 0x0000ffff) + (bits >> 16);
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt_min = 100000;
  uint32_t us = 0;
  for (int i = 0; i < n; i++) {
    us <<= 1;
    if (s[i] == '#') us |= 0x1;
  }
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    uint32_t x = 0;
    x |= (uint32_t)(pow(2, i) - 1);
    x ^= us;
    cnt = bitCount(x);
    if (cnt < cnt_min) cnt_min = cnt;
  }
  cout << cnt_min << endl;
  return 0;
}
