#include <iostream>
using namespace std;

int main() {
    int choice;
    double tempInput, celsius;

    cout << "Temperature Converter to Celsius" << endl;
    cout << "1. Fahrenheit to Celsius" << endl;
    cout << "2. Kelvin to Celsius" << endl;
    cout << "Enter your choice (1 or 2): ";
    cin >> choice;

    // بررسی انتخاب کاربر
    if (choice == 1) {
        cout << "Enter temperature in Fahrenheit: ";
        cin >> tempInput;
        // تبدیل فارنهایت به سانتی‌گراد
        celsius = (5.0 / 9.0) * (tempInput - 32);
        cout << "Temperature in Celsius: " << celsius << " °C" << endl;
    } else if (choice == 2) {
        cout << "Enter temperature in Kelvin: ";
        cin >> tempInput;
        // تبدیل کلوین به سانتی‌گراد
        celsius = tempInput - 273.15;
        cout << "Temperature in Celsius: " << celsius << " °C" << endl;
    } else {
        cout << "Invalid choice!" << endl;
    }

    return 0;
}