# https://tenka1-2019-beginner.contest.atcoder.jp/tasks/tenka1_2019_c

import itertools
from collections import Counter
import bisect

def main():
    N = int(input())
    S = list(input())
    # print(S)

    first = -1
    for i in range(len(S)):
        if S[i] != '.':
            first = i
            break
    if first == -1: # all white
        print(0)
        exit()

    next_s = list(reversed(S[first:]))
    last = -1
    for i in range(len(next_s)):
        if next_s[i] != '#':
            last = i
            break
    if last == -1: # all black
        print(0)
        exit()

    next_s = next_s[last:]
    # 全部黒か全部白
    print(min(next_s.count('.'), next_s.count('#')))

if __name__ == '__main__':
    main()
