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; } long ans = 1; long t = (long)a*ans * 60; long p = (long)b *ans+(long) c * 60 * 60; while (t < p) { t = (long)a*ans * 60; p = (long)b *ans+(long) c * 60 * 60; ans++; } System.out.println(ans-1); } }