import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    S = input().strip()

    a = 0
    c = S[0]
    for i in range(1, N):
        if c == '#' and S[i] == '.':
            a += 1
            c = '#'
        else:
            c = S[i]

    b = 0
    c = S[-1]
    for i in range(N - 2, -1, -1):
        if c == '.' and S[i] == '#':
            b += 1
            c = '.'
        else:
            c = S[i]

    print(min(a, b))
    

if __name__ == '__main__':
    main()

