import java.io.*; import java.util.Scanner; public class Main_yukicoder734 { private static Scanner sc; private static Printer pr; private static void solve() { long a = sc.nextInt(); long b = sc.nextInt(); long c = sc.nextInt(); // 60 a x >= b x + 3600c if (60 * a - b <= 0) { pr.println(-1); } else { long x = (3600 * c + 60 * a - b - 1) / (60 * a - b); pr.println(x); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }