import string


def rot_char(char, count):
    """
    Rotate a single character by count positions if it is in A-Z or a-z.
    """

    if char in string.ascii_uppercase:
        c = ord(char) + count
        while c > ord('Z'):
            c -= 26
        while c < ord('A'):
            c += 26
        return chr(c)
    if char in string.ascii_lowercase:
        c = ord(char) + count
        while c > ord('z'):
            c -= 26
        while c < ord('a'):
            c += 26
        return chr(c)
    return char