#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin >> N;
    string S;
    cin >> S;
    int ans = 0;
    bool check = false;
    for (int i = 0; i < N; i++)
    {
        if (S[i] == '#' and check == false)
        {
            check = true;
        }
        if (check == true)
        {
            if (S[i] == '.')
            {
                ans++;
            }
        }
    }
    bool check = false;
    int tmp = 0;
    for (int i = N - 1; i >= 0; i--)
    {
        if (S[i] == '.' and check == false)
        {
            check = true;
        }
        if (check == true)
        {
            if (S[i] == '#')
            {
                tmp++;
            }
        }
    }
    cout << min(tmp, ans) << endl;
    return 0;
}