#include <bits/stdc++.h>
using namespace std;
int ans, n, cnt1, cnt2;
string str;
int main() {
  scanf("%d", &n);
  cin >> str;
  for (int i = n - 1; i >= 0; i--) {
    if (str[i] == '#')
      cnt1--;
    else
      break;
  }
  for (int i = 0; i < n; i++)
    if (str[i] == '#') cnt1++;
  for (int i = 0; i < n; i++)
    if (str[i] == '.')
      cnt2--;
    else
      break;
  for (int i = 0; i < n; i++)
    if (str[i] == '.') cnt2++;
  printf("%d", min(cnt1, cnt2));
  return 0;
}
