def cutw(s,n):
    t = 0
    for i in range(n):
        if s[i] == '#':
            break
        else:
            t += 1
    s = s[t:]
    n = len(s)
    return s,n

def cutb(s,n):
    t = n
    for i in range(n-1, -1,-1):
        if s[i] == '.':
            break
        else:
            t -= 1
    s = s[:t]
    n = len(s)
    return s,n

def main():
    n = int(input())
    s = input()
    res = 0
    s1 = s
    n1 = n
    res1 = 0
    while True:
        s,n = cutw(s,n)
        if n>0:
            s = '.'+s[1:]
            res += 1
        else:
            break
    while True:
        s1,n1 = cutb(s1,n1)
        if n1>0:
            s1 = s1[:n1-1] + '#'
            res1 += 1
        else:
            break
    print(min(res,res1))


if __name__ == '__main__':
    main()