def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    s = input()
    b = w = 0
    f = 0
    for i in range(N):
        if f == 0 and s[i] == '#': f = 1
        if f == 1 and s[i] == '.': w += 1
    f = 0
    for i in range(N):
        if f == 0 and s[-1-i] == '.': f = 1
        if f == 1 and s[-1-i] == '#': b += 1
    print(min(b, w))

    return

if __name__ == '__main__':
    main()
