def main(word):
    strs = list(word)

    if strs.count('#') < strs.count('.'):
        if strs[len(strs)-1] == "#":
            return strs.count("#")-1
        else:
            return strs.count("#")

    count = 0
    iRegular = False
    for i, _ in enumerate(strs):
        if i == 0:
            continue
        if strs[i-1] == "#" and strs[i] == ".":
            count += 1
            continue

        if i < 2:
            continue
        if iRegular and strs == ".":
            count += 1
            continue
        else:
            iRegular = False
        if strs[i-2] == "#" and strs[i-1] == "." and strs[i] == ".":
            iRegular = True
            count += 1

    return count


if __name__ == "__main__":
    input()
    word = input()
    print(main(word))
