import enum
from typing import Generic, Self, TypeVar, overload

U = TypeVar('U', bound='QuantityUnit')

class Quantity(int, Generic[U]):
    @overload
    def __add__(self, other: Quantity[U]) -> Quantity[U]: ...
    @overload
    def __add__(self, other: int) -> int: ...
    @overload
    def __sub__(self, other: Quantity[U]) -> Quantity[U]: ...
    @overload
    def __sub__(self, other: int) -> int: ...
    def __mul__(self, other: int | float) -> Quantity[U]: ...
    def __truediv__(self, other: int | float) -> Quantity[U]: ...

class QuantityUnit(enum.Enum):
    @property
    def value(self) -> int: ...
    def __rmatmul__(self, scalar: float | int) -> Quantity[Self]: ...
    def __rrshift__(self, quantity: Quantity[Self]) -> float: ...
    def __rfloordiv__(self, quantity: Quantity[Self]) -> int: ...
