import java.util.Scanner; public class Main { @SuppressWarnings("resource") public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); int c = scanner.nextInt(); if (a * 60 > b ) { System.out.println(-1); return; } int ans = 1; int t = a*ans * 60; int p = b *ans+ c * 60 * 60; while (t < p) { t = a * 60 * ans; p = b * ans + c * 60 * 60; ans++; } System.out.println(ans-1); } }