import java.util.Scanner;

public class AudioStorageCalculator
{
    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);
        
        System.out.print("Enter audio duration in seconds: ");
        int trackSeconds = scanner.nextInt();
        System.out.print("Enter sample rate in kHz (e.g., 44.1): ");
        double sampleRateKhz = scanner.nextDouble();
        System.out.print("Enter bit depth (e.g., 16): ");
        int bitDepth = scanner.nextInt();
        System.out.print("Enter channel count (1 for Mono, 2 for Stereo): ");
        int channelCount = scanner.nextInt();

        System.out.println("\nCalculating storage metrics...");

        // Convert kHz to Hz for accurate physical sampling math
        int sampleRateHz = (int) (sampleRateKhz * 1000);

        // Math Engine: Calculate pure audio data payload in bytes
        long totalSamples = (long) trackSeconds * sampleRateHz * channelCount;
        long totalBytes = (totalSamples * bitDepth) / 8;
            
        // Calculate operating system file size standard (Base-2: 1 KB = 1024 Bytes)
        double sizeInBinaryKB = totalBytes / 1024.0;

        // Display Outputs
        System.out.println("Raw Payload Bytes: " + totalBytes);
        System.out.println("Calculated Audio Size: " + sizeInBinaryKB + " KB");
    }
}