def euler_totient(n):
    result = n
    p = 2
    while p * p <= n:
        # Check if p is a prime factor
        if n % p == 0:
            # If yes, then update n and result
            while n % p == 0:
                n //= p
            result -= result // p
        p += 1
    # If n is a prime number greater than 2
    if n > 1:
        result -= result // n
    return result

# Example usage
n = 10
print(f"Euler's totient function of {n} is: {euler_totient(n)}")