import re


def golang_duration_to_seconds(d: str) -> int:
    """
    Convert values like "276h41m7s" to number of seconds
    """

    add = ""
    for c in ["s", "m", "h"]:
        if d.endswith(c):
            break
        add += "0" + c
    d += add
    hms = [int(x) for x in re.split(r"\D", d)[:-1]]
    res = hms[-1]
    if len(hms) > 1:
        res += hms[-2] * 60
        if len(hms) > 2:
            res += hms[-3] * 60 * 60
    return res