def parse_file_size(s):
    """Return int from file size (1234, 55G, 1.7T)."""
    if not s:
        return int(s)
    suffix = s[-1]
    power = 1000
    try:
        factor = {'K': power, 'M': power ** 2, 'G': power ** 3, 'T': power **
            4, 'P': power ** 5}[suffix]
        s = s[:-1]
    except KeyError:
        factor = 1
    return int(float(s) * factor)
