#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int black = 0;
  int white = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      black++;
    else
      white++;
  }
  int firstW = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      firstW++;
    else
      break;
  }
  int lastB = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '#')
      lastB++;
    else
      break;
  }
  cout << min(black - lastB, white - firstW) << endl;
}
void cheatsheet() {
  vector<int> vecloop;
  for (int i = 0; i < 10; i++) {
    vecloop.push_back(i);
  }
  int a = 1;
  int b = 5;
  swap(a, b);
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  sort(arr, arr + 9, greater<int>());
  vector<int> vec(arr, end(arr));
  sort(vec.begin(), vec.end());
  cout << lower_bound(vec.begin(), vec.end(), 2)[0];
  map<pair<long long, long long>, long long> m;
  m[pair<long long, long long>(10, 100)] = 100;
}
