#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    char *s, tmp = 0;
    int n, i, cnt = 0;

    scanf("%d", &n);
    s = malloc(sizeof(char) * (n + 1));
    scanf("%s", s);

    for (i = n - 1; i >= 0; i--)
    {
        if (s[i + 1] == '.' && s[i] == '#')
        {
            cnt++;
        }
    }

    printf("%d\n", cnt);
    return 0;
}