#include <iostream>
using namespace std;
 
int main()
{
  int N, count1 = 0, count2 = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 1; i++)
  {
    if (S.at(i) == '#' && S.at(i + 1) == '.')
      count1++;
  }
  for (int i = 0; i < N - 1; i++)
  {
    if (S.at(i + 1) == '#' && S.at(i) == '.')
    {
      j = i + 1
      while (S.at(j) == '#')
      count2++;
      j++;
    }
  }
  cout << min(count1, count2) << endl;
}