Problem:


Score : 100 points

Problem Statement

In this problem, we use the 24-hour clock.

Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.)
He has decided to study for K consecutive minutes while he is up.
What is the length of the period in which he can start studying?

Constraints

0 \le H_1, H_2 \le 23

0 \le M_1, M_2 \le 59

The time H_1 : M_1 comes before the time H_2 : M_2.

K \ge 1

Takahashi is up for at least K minutes.

All values in input are integers (without leading zeros).

Input

Input is given from Standard Input in the following format:

H_1 M_1 H_2 M_2 K

Output

Print the length of the period in which he can start studying, as an integer.

Sample Input 1

10 0 15 0 30

Sample Output 1

270

Takahashi gets up at exactly ten in the morning and goes to bed at exactly three in the afternoon.
It takes 30 minutes to do the study, so he can start it in the period between ten o'clock and half-past two. The length of this period is 270 minutes, so we should print 270.

Sample Input 2

10 0 12 0 120

Sample Output 2

0

Takahashi gets up at exactly ten in the morning and goes to bed at exactly noon. It takes 120 minutes to do the study, so he has to start it at exactly ten o'clock. Thus, we should print 0.



Sample input:
10 0 15 0 30


Sample output:
270

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

FT = H1 * 60 + M1
LT = H2 * 60 + M2

T = LT - FT
if T > K:
    print(T - K)
else:
    print(0)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

hm1 = h1*60+m1
hm2 = h2*60+m2

print(hm2-hm1-k)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
h = H2 - H1
m = M2 - M1
minutes = 60*h + m
print(abs(minutes - K))

Submission status: Accepted

Solution code:
a,b,c,d,e=map(int,input().split())
s=a*60+b
t=c*60+d
u=t-e
v=u-s
print(v)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int,input().split())


wake_minute = h1*60 + m1
sleep_minute = h2*60 +m2

can_last = sleep_minute -k
print(can_last-wake_minute)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int, input().split())
if m2-m1 < 0:
    h2 -= 1
    m2 += 60
    x = (h2-h1)*60+m2-m1
    print(x-k)
else:
    x = (h2-h1)*60+m2-m1
    print(x-k)

Submission status: Accepted

Solution code:
h, m, x, y, k = map(int, input().split())
mi = x*60 + y - (h*60+m) - k
print(mi)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K  = map(int, input().split())
time = 60*(H2-H1)+M2-M1
if time > K:
    print(time-K)
else:
    print(0)

Submission status: Accepted

Solution code:
start_h, start_m, end_h, end_m, K = [int(s) for s in input().split()]

time = (end_h - start_h) * 60 + end_m - start_m
print(time - K)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    H1, M1, H2, M2, K = [int(i) for i in input().strip().split()]
    return (H2*60 + M2) - (H1*60 + M1) - K


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
H,M,K,T,S = map(int,input().split())
print(max(((K*60+T-H*60-M-S)+1440)%1440,0))

Submission status: Accepted

Solution code:
a,b,c,d,e = map(int, input().split())
val = (c-a)*60+(d-b)
print(val-e)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int,input().split())

ans = 60*(h2-h1) + (m2-m1) - k

print(ans)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,K=map(int, input().split())

x1=h1*60+m1
x2=h2*60+m2

print(x2-x1-K)

Submission status: Accepted

Solution code:
A, B, C, D, E = map(int, input().split())
oki =60*(C-A)+D-B
print(oki-E)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
t = H2*60+M2-H1*60-M1
print(t-K)

Submission status: Accepted

Solution code:
#list(map(int,input().split()))
a,b,c,d,e=list(map(int,input().split()))
print(c*60+d-a*60-b-e)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int,input().split())
time = (60*h2+m2)-(60*h1+m1)
ans = time-k
print(ans)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
s=h2*60+m2-k-(h1*60+m1)
print(s)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K=map(int,input().split())
if M1<M2:
    H=H2-H1
    M=M2-M1
else:
    M=M2+60-M1
    H=H2-1-H1
print(M+60*H-K)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b,c,d,e = map(int,input().split())
p = a * 60 + b
q = c * 60 + d
x = q - p
print(x - e)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int, input().split())
getup = h1*60+m1
sleep = h2*60+m2
ans = sleep - k - getup
print(ans)

Submission status: Accepted

Solution code:
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
def Yes(x):print("Yes")if x==True else print("No")
h1,m1,h2,m2,k=NM()
x=h1*60+m1
y=h2*60+m2
if y>x:
    print(y-x-k)
else:
    print(y+60*24-x-k)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    H,M,H2,M2,K=MI()
    B = H2*60 + M2
    A = H*60+M
    print(max(0, B-K-A))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())
ans = (H2-H1)*60 + M2-M1 - K
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
import heapq
import itertools
MAX_INT = int(10e25)
MIN_INT = -MAX_INT
mod = 998244353
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

h1,m1,h2,m2,k = IL()

h = h2 - h1
m = m2 - m1
total = h*60 + m

print(total- k)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(H: "List[int]", M: "List[int]", K: int):
    assert H[0] <= H[1]
    t1 = 60 * H[0] + M[0]
    t2 = 60 * H[1] + M[1]
    # 制約がよくわからない
    return max(0, t2 - t1 - K)

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = [int()] * (2)  # type: "List[int]"
    M = [int()] * (2)  # type: "List[int]"
    for i in range(2):
        H[i] = int(next(tokens))
        M[i] = int(next(tokens))
    K = int(next(tokens))  # type: int
    print(solve(H, M, K))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
t = (h2 - h1) * 60 + (m2 - m1)
if t < k:
  print(0)
else:
  print(t-k)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())

dh = H2 - H1
dm = M2 - M1

d = dh * 60 + dm
print(d - K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

H1 = h1 * 60
H2 = h2 * 60
res = H2+m2-k-H1-m1
print(res)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
min1 = H1*60 + M1
min2 = H2*60 + M2
print(min2 -min1 -K)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = [int(i) for i in input().split()]
print((((H2 - H1) * 60) + (M2 - M1)) - K)

Submission status: Accepted

Solution code:
h_1, m_1,  h_2, m_2, k = map(int,input().split())

minute = (h_2-h_1) * 60 + (m_2-m_1) - k

print(minute)

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

from datetime import timedelta, datetime

h1, m1, h2, m2, k = list(map(int, sys.stdin.buffer.readline().split()))

a = h1 * 60 + m1
b = h2 * 60 + m2
d =b - a
# print(d.minute - k)

print(d - k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int,input().split())
h_diff = h2 - h1
m_diff = m2 - m1
if m_diff < 0:
  t = (h_diff - 1) * 60 + (60 + m_diff)
else:
  t = h_diff * 60 + m_diff
result = t - k
print(result)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

a = 0
if H1 < H2:
    a = (H2-H1)*60+M2-M1
else:
    a = M2-M1

print(a-K)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
a,b,c,d,e = map(int,input().split())
print(max((c-a)*60+(d-b)-e,0))

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

hour = H2 - H1
min = M2 - M1

if min < 0:
    hour -= 1
    min += 60

res = hour * 60 + min - K
print(res)

Submission status: Accepted

Solution code:
from numba import njit


@njit
def main(h, m, H, M, K):
    return max((H-h)*60+(M-m)-K, 0)


h, m, H, M, K = map(int, input().split())


print(main(h, m, H, M, K))

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k  = map(int, input().split())

ans=(h2-h1)*60 + m2-m1 -k

print(ans)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K=map(int,input().split())
hoursa=H2-H1
minsa=M2-M1
tmp=hoursa*60+minsa
ans=tmp-K
print(ans)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

t1 = h1 * 60 + m1
t2 = h2 * 60 + m2

ans = t2 - t1 - k
if ans < 0:
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int,input().split())
h=(h2-h1)*60
m=m2-m1
print(h+m-k)

Submission status: Accepted

Solution code:

h1,m1,h2,m2,k = map(int,input().split())

start = h1*60+m1
end = h2*60+m2

ans = end-start-k

print(ans)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
t = (H2*60 + M2) - (H1*60 + M1) - K
print(t)

Submission status: Accepted

Solution code:
x = list(map(int,input().split()))
ans = (x[2]-x[0])*60 + x[3]-x[1] - x[4]
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

A, B, C, D, K = mi()

print(C*60+D-A*60-B-K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
t1 = h1 * 60 + m1
t2 = h2 * 60 + m2
print(t2-t1 - k)

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))

b = a[0]*60 + a[1]
c = a[2]*60 + a[3]

if c-b<a[4]:
    print(0)
else:
    print(c-b-a[4])

Submission status: Accepted

Solution code:
l=list(map(int, input().split(' ')))
start = l[0]*60+l[1]
end = l[2]*60+l[3]
print(end-start-l[4])

Submission status: Accepted

Solution code:
#import numpy as np
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with

#A = int(input())
H1,M1,H2,M2,K= map(int,input().split())
#A = list(map(int,input().split()))
#B = list(map(int,input().split()))
#S= str(input())

H=(H2-H1)*60 + (M2-M1)
m=H-K
print(m)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

print((h2 - h1)*60 + (m2 - m1) - k)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

H1, M1, H2, M2, K = map(int, readline().split())

ans = (H2 * 60 + M2 - K) - (H1 * 60 + M1)
print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
def main():
    H, M, h, m, K = map(int, input().split())
    ans = 0
    while True:
        if H == h and M == m:
            break
        M += 1
        ans += 1
        if M == 60:
            M = 0
            H += 1
    print(ans - K)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#[int(x) for x in input().split()]
#map(int,input().split())
#for _ in range(int(input())):
a,b,c,d,k=map(int,input().split())
strt=a*60+b
end=c*60+d
print(end-k-strt)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K=map(int, input().split())

if H1==H2:
    x=M2-M1
    ms=x-K
else:
    ms=(60-M1)+(H2-H1-1)*60+M2-K
print(max(0, ms))

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())

H = H2 - H1
M = M2 - M1

time = H*60 + M

print(time-K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

m1 = h1*60 + m1
m2 = h2*60 + m2

sa = m2 - m1

print(sa - k)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
if ((h2-h1)*60+(m2-m1)-k)>=0:
    print((h2-h1)*60+(m2-m1)-k)
else:
    print(0)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int, input().split())

print((h2*60+m2)-(h1*60+m1) - k)

Submission status: Accepted

Solution code:
import numpy as np
import math
import collections

H1, M1, H2, M2, K = map(int, input().split())

print(60 * H2 + M2 - 60 * H1 - M1 - K)

Submission status: Accepted

Solution code:
a,b,c,d,e=map(int,input().split())
f=(c-a)*60+(d-b)-e
print(f)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
time = max((h2 * 60 + m2) - (h1 * 60 + m1) - k, 0)
print(time)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

getup = H1*60 + M1
gotobed = H2*60 + M2

print(gotobed - getup - K)

Submission status: Accepted

Solution code:

H1, M1, H2, M2, K = [int(k) for k in input().split()]

a = (H2 - H1) * 60 + (M2 - M1) - K

print(a)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

H_1, M_1, H_2, M_2, K = map(int, input().split())

print((H_2 - H_1)*60 + M_2 - M_1 - K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
ans = (h2-h1)*60+(m2-m1)-k
print(ans)

Submission status: Accepted

Solution code:
def main():
    H1, M1, H2, M2, K = map(int, input().split())
    print((H2 * 60 + M2) - K - (H1 * 60 + M1))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
gh,gm,sh,sm,k=map(int,input().split())
print(sh*60+sm-(gh*60+gm)-k)

Submission status: Accepted

Solution code:
# = int(input())
H, M, h, m, K = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

count = 0

count += m-M
count += (h-H)*60
count -= K

print(count)

Submission status: Accepted

Solution code:
H,M,h,m,K = map(int,input().split())

x = h*60 + m - H*60 - M
print(x-K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
if h1 == h2:
    print(m2 - m1 - k)
else:
    x = 0
    x = 60 - m1
    x += m2
    x += 60 * (h2 - h1 - 1)
    print(x - k)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K=list(map(int,input().split()))
print(H2*60+M2-K-(H1*60+M1))

Submission status: Accepted

Solution code:

h1,m1,h2,m2,k=map(int,input().split())

time1=h1*60+m1
time2=h2*60+m2

diff=time2-time1

print(diff-k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = [int(x) for x in input().split()]

ans = (h2 * 60 + m2) - (h1*60 + m1) - k

print(max(0, ans))

Submission status: Accepted

Solution code:
H,M,h,m,K=map(int,input().split())

b=H*60+M
a=h*60+m

print(a-b-K)

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

A, B, C, D, E = [int(x) for x in stdin.readline().rstrip().split()]
# A, B = [int(x) for x in stdin.readline().rstrip().split()]
# U = input().split()
x=A*60+B
y=C*60+D
print(y-x-E)

Submission status: Accepted

Solution code:
H_1,M_1,H_2,M_2,K=map(int,input().split())

interval=60*(H_2-H_1)+M_2-M_1
ans=interval-K

print(ans)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = [int(i) for i in input().split()]
time1 = h1 * 60 + m1
time2 = h2 * 60 + m2
print(time2 - time1 -k)

Submission status: Accepted

Solution code:
h,m,s,t,k=map(int,input().split())
print(max(0,s*60+t-(60*h+m)-k))

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

j1 = h1*60 + m1
j2 = h2*60 + m2

if j2-j1 < k:
    print(0)
else:
    a = j2-j1-k
    print(a)

Submission status: Accepted

Solution code:
a,b,c,d,e=map(int,input().split())
x=60*a+b
y=60*c+d
print(y-x-e)

Submission status: Accepted

Solution code:
def main():
    h1, m1, h2, m2, k = [int(e) for e in input().split()]

    ans = h2 * 60 + m2 - h1 * 60 - m1 - k
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:



h1, m1, h2, m2, k =map(int, input().split())

ans = (h2-h1)*60+(m2-m1)-k
print(ans)

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
S = H1*60+M1
F = H2*60+M2
ans = F-S-K
print(ans)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
minute = 60 * (h2 - h1) + (m2 - m1)
print(minute - k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
start = h1 * 60 + m1
end = h2 * 60 + m2
ans = end - start - k
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

h1,m1,h2,m2,k = I2()
m = (h2-h1)*60+(m2-m1)
#print(m)
print(max(0,m-k))

Submission status: Accepted

Solution code:
h_1, m_1, h_2, m_2, k = map( int, input().split() )
print( 60 * ( h_2 - h_1 ) + ( m_2 - m_1 ) - k )

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline()[:-1]


H1, M1, H2, M2, K = map(int, input().split())
start_time = H1*60 + M1
end_time = H2*60 + M2

print(end_time - start_time - K)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
h1, m1, h2, m2, k = M()
a = h1*60 + m1
b = h2*60 + m2
print(max(b-k-a, 0))

Submission status: Accepted

Solution code:
a,b,c,d,e=map(int,input().split())

f=c*60+d-a*60-b


if f-e>=0:
  print(f-e)
else:
  print(0)

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.buffer.readline
    h1,m1,h2,m2,k = map(int, input().split())
    rem = h2*60+m2-h1*60-m1
    print(rem-k)
    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b,c,d,K = map(int,input().split())
print((60*c+d)-(60*a+b)-K)

Submission status: Accepted

Solution code:
from sys import stdin, stdout
# t = int(input())
# for _ in range(t):
    # n = int(stdin.readline())
h1, m1, h2, m2, k = map(int, stdin.readline().strip().split())
    # nums = list(map(int, stdin.readline().strip().split()))

t = (h2*60 + m2 - (h1*60 + m1) -  k)
print(t if t>0 else 0)

Submission status: Accepted

Solution code:
def main() -> None:
    H1, M1, H2, M2, K = map(int, input().split())
    start = H2 * 60 + M2 - H1 * 60 - M1
    if start < 0:
        start += 24 * 60

    print(start - K)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())

mae = H1*60 + M1
ato = H2*60 + M2
tmp = ato - mae

if K > tmp:
    print(K)
else:
    print(tmp - K)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int, input().split())
print((h2-h1)*60 + m2-m1 -k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = list(map(int, input().split()))

result = (h2 * 60 + m2) - (h1 * 60 + m1) - k
print(result)

Submission status: Accepted

Solution code:
def main():
    h1, m1, h2, m2, k = map(int, input().split())

    t = (h2 * 60 + m2) - (h1 * 60 + m1)
    print(max(0, t - k))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = list(map(int, input().split()))

m = 60 +X[3] - X[1]
h = X[2] - X[0] -1

print(h*60 +m - X[4])

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

print(60*(h2-h1)+m2-m1-k)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
h1, m1, h2, m2, k = map(int, input().split())
print(max((h2-h1)*60 + (m2-m1)-k,0))

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
ren=h2*60+m2-h1*60-m1
print(ren-k)

Submission status: Accepted

Solution code:
h, m, h2, m2, k = map(int, input().split())
print(60*h2+m2-(60*h+m+k))

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
print(max(0, h2*60-h1*60+m2-m1-k))

Submission status: Accepted

Solution code:
a,b,c,d,e = map(int,input().split())
print((c*60+d)-(a*60+b)-e)

Submission status: Accepted

Solution code:
h1 ,m1 ,h2 ,m2 , k = map(int,input().split())

x = h2*60+m2-h1*60-m1

if x<=k:
    print(0)
else:
    print(x-k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
print((h2 * 60 + m2) - (h1 * 60 + m1) - k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

hour = h2 - h1
mins = m2 - m1

ans = hour * 60 + mins - k
print(ans)

Submission status: Accepted

Solution code:
inh = [int(i) for i in input().split()]

print(inh[2]*60+inh[3]-inh[0]*60-inh[1]-inh[4])

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int,input().split())
ans = (h2 - h1)*60
ans = ans + (m2 - m1) -k
print(ans)

Submission status: Accepted

Solution code:
import sys, math,os
from io import BytesIO, IOBase
from bisect import bisect_left as bl, bisect_right as br, insort
#from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
#from itertools import permutations,combinations
def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write(' '.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
sys.setrecursionlimit(100000)
from fractions import Fraction
INF = float('inf')
mod = 998244353


def main():

    h1,m1,h2,m2,k=mdata()
    out(h2*60+m2-h1*60-m1-k)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = map(int,input().split())

d1 = h2-h1
if m2 >= m1:
    d2 = m2-m1
else:
    d2 = 60 + m2 -m1
    d1 -= 1
print(d1*60+d2-k)

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    a, b, c, d, k  = i_map()

    h = c - a
    m = d - b

    ans = h * 60 + m

    print(ans-k)
            
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

study = 60 * H2 + M2 - 60 * H1 - M1 - K
print(study)

Submission status: Accepted

Solution code:
# 別変数の整数複数個
H1, M1, H2, M2, K = [int(x) for x in input().strip().split(" ")]

B = H1 * 60 + M1
A = H2 * 60 + M2
if H1 > H2:
    A += 24 * 60

print(A-B-K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = [int(x) for x in input().split()]

ms = m1 + h1*60
me = m2 + h2*60
print(me-ms-k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

t1 = h1*60 + m1
t2 = h2*60 + m2
t = t2 - t1

print(t - k)

Submission status: Accepted

Solution code:
h,m,H,M,k=map(int,input().split())
print(60-m+M+60*(H-h-1)-k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

wake = 60 * h1 + m1
sleep = 60 * h2 + m2
waking = sleep - wake
res = waking - k
print(res)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

H_1, M_1, H_2, M_2 ,K = map(int,input().split())

print(H_2*60+M_2 - (H_1*60+M_1) - K)

Submission status: Accepted

Solution code:
import numpy as np

H1,M1,H2,M2,K = (int(x) for x in input().split())

T1 = H1*60+M1
T2 = H2*60+M2

ans = T2 - K -T1
print(ans)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

hours = H2 - H1
mins = M2 - M1
time = 60 * (hours) + mins - K

print(time)

Submission status: Accepted

Solution code:
a,b,c,d,k = map(int,input().split())
x = 60*a + b
y = 60*c + d
tmp = y-x-k
if tmp < 0:
    print(0)
else:
    print(tmp)

Submission status: Accepted

Solution code:
h,m,h1,m1,k=map(int,input().split())
if m1<m:
    m1+=60
    h1-=1
print(max(0,(h1-h)*60+(m1-m)-k))

Submission status: Accepted

Solution code:

def main():
    H1, M1, H2, M2, K = list(map(int, input().split()))
    t1 = H1 * 60 + M1
    t2 = H2 * 60 + M2
    print(t2 - t1 - K)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

total = (H2 - H1) * 60 + M2 - M1
print(total - K)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
awake_minutes = (h2 - h1) * 60 + m2 - m1

print(awake_minutes - k)

Submission status: Accepted

Solution code:
def main():
    H1, M1, H2, M2, K = map(int, input().split())
    time = (60*H2 + M2) - (60*H1+M1)
    ans = time - K
    print(ans)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
  h1,m1,h2,m2,k=map(int,input().split())
  a=60*(h2-h1)+(m2-m1)
  print(max(0,a-k))
if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
import numpy as np
h1, m1, h2, m2, k = np.array(list(map(int, input().split())))
h = h2 - h1
m = m2-m1
t = h*60 + m
print(t-k)

Submission status: Accepted

Solution code:
h1, m1, h2, m2, K = map(int, input().split())

start = h1 * 60 + m1
goal = h2 * 60 + m2 - K

if start < goal:
    print(goal - start)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
RS = input
RI = lambda x=int: x(RS())
RA = lambda x=int: map(x, RS().split())
RSS = lambda: RS().split()


def solve():
    start = h1*60 + m1
    end = h2*60 + m2
    print(end- k - start)
    return



h1, m1, h2, m2, k = RA()
solve()

Submission status: Accepted

Solution code:
a,b,c,d,e=map(int,input().split())

if -(a*60+b)+(c*60+d)-e <0:
        print(0)
        exit()
print(-(a*60+b)+(c*60+d)-e)

Submission status: Accepted

Solution code:
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    h1, m1, h2, m2, k = [int(x) for x in input().strip().split()]
    t1 = 60 * h1 + m1
    t2 = 60 * h2 + m2
    if t2 < t1:
        t2 = 60 * (h2 + 24) + m2
    print(t2 - t1 - k)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
L = (H2-H1)*60+(M2-M1)
print(L-K)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
print(60*(h2-h1)+(m2-m1)-k)

Submission status: Accepted

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

h = H2 - H1
m = M2 - M1
ans = h * 60 + m
print(max(0, ans - K))

Submission status: Accepted

Solution code:
H1,M1,H2,M2,K = list(map(int,input().split()))

X = (H2-H1)*60+M2-M1
print(X-K)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
t=(60*h2+m2)-(60*h1+m1)
print(t-k)