#include <bits/stdc++.h>
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int N;
  std::string S;
  std::cin >> N >> S;
  int ans1 = 0;
  int ans2 = 0;
  int i = 0;
  for (; S[i] != '#' && i < N; ++i)
    ;
  for (; i < N; ++i)
    if (S[i] == '.') ++ans1;
  int j = N - 1;
  for (; S[j] != '#' && j >= 0; --j)
    ;
  for (; j >= 0; --j)
    if (S[j] == '#') ++ans2;
  int ans = std::min(ans1, ans2);
  std::cout << ans << std::endl;
}
