Problem:


Score : 100 points

Problem Statement

How many ways are there to choose two distinct positive integers totaling N, disregarding the order?

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

4

Sample Output 1

1

There is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)

Sample Input 2

999999

Sample Output 2

499999



Sample input:
4


Sample output:
1

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)


def main():
    N = int(input())
    num = 0
    for i in range(1, N):
        if i >= N - i:
            break
        num += 1
    print(num)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

if n <= 2:
    print(0)
elif n % 2 == 0:
    print(n//2-1)
else:
    print((n+1)//2 - 1)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0

for i in range(1,(n//2)+1):
    if i!=(n-i):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 1:
  print((n-1)//2)
else:
  print(n//2 - 1)

Submission status: Accepted

Solution code:
n = int(input())
print(((n+1)//2)-1)

Submission status: Accepted

Solution code:
N = int(input())
if N%2 == 0:
    print((N//2) -1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
  print(int(N/2 - 1))
else:
  print(int(N/2))

Submission status: Accepted

Solution code:
N = int(input())
if N %2 == 0:
    print(N//2-1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print(n // 2 -1)
else:
    print(max(0, (n-1)//2))

Submission status: Accepted

Solution code:
import sys
N = int(sys.stdin.readline().strip())
print((N - 1) // 2)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    if N % 2 == 0:
        N -= 1
    print(N // 2)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
if n%2==0:
    print(n//2 -1 )
else:
    print(n//2)

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
    print((n//2)-1)
else:
    print((n-1)//2)

Submission status: Accepted

Solution code:
N = int(input())
if N%2==0:
    print(N // 2 - 1)
else:
    print((N-1)//2)

Submission status: Accepted

Solution code:
A = int(input())
print((A-1)//2)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print(int((n / 2) - 1))
else:
    print(n // 2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
if n % 2 == 0:
    print(n // 2 - 1)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
N = int(input())

print((N -1) // 2)

Submission status: Accepted

Solution code:
print( (int(input()) - 1) // 2)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
if n%2:
    print(n//2)
else:
    print(n//2-1)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    if n % 2 == 0:
        print(int(n/2)-1)
    else:
        print(n//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
  print(n//2-1)
else:  
  print(n//2)

Submission status: Accepted

Solution code:
n  = int(input())
if n % 2 == 0:
    print((n - 2) // 2)
else:
    print((n - 1) // 2)

Submission status: Accepted

Solution code:
def main():
    n = int(input())

    ans = (n - 1) // 2

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    n=int(input())
    print((n-1)//2)

main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
if n % 2 == 0:
    print((n-1)//2)
else:
    print(n//2)

Submission status: Accepted

Solution code:
N = int(input())

print(int((N - 1) // 2))

Submission status: Accepted

Solution code:
N = int(input())
print(N // 2 - 1 if N == 2 else (N - 1) // 2)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print((n // 2)-1)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
N = int(input())
print(N//2-1 if N%2 ==0 else N//2)

Submission status: Accepted

Solution code:
def nums():
    return list(map(int,input().split(" ")))
def num():
    return int(input())
def yakusu(n):
    res = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            res.add((i,int(n/i)))
    return res
import math
x = num()
print(math.ceil(x / 2 - 1))

Submission status: Accepted

Solution code:
N = int(input())

if (N % 2==0):
    print(N//2-1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    return math.ceil(N / 2) - 1


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = (N - 1) // 2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
print(int(n/2)-1) if n%2 == 0 else print(int(n/2))

Submission status: Accepted

Solution code:
n = int(input())
print(n//2 if n%2==1 else n//2-1)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math
import collections

N, = map(int, sys.stdin.readline().rstrip().split(" "))
print(N//2-1+N%2)
exit(0)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
    print(int((n/2)-1))
else:
    print(int((n-1)/2))

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
    ans=N//2-1
else:
    ans=(N-1)//2
print(ans)

Submission status: Accepted

Solution code:
N = int(input().strip())

print((N-1)//2)

Submission status: Accepted

Solution code:
N = int(input())

print((N-1) // 2)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
    print(n//2 - 1)
else:
    print(n//2)

Submission status: Accepted

Solution code:

import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
print((n-1)//2)

Submission status: Accepted

Solution code:


n = int(input())

ret=(n-1)//2

print(ret)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())

print((N-1)//2)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    if N & 1:
        print(N//2)
    else:
        print(N//2-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    if N % 2 == 0: return (N-2)//2
    return N//2
if __name__ == '__main__':
    # main()
    print(main())

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print((n-1) // 2)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0:
    print(N//2-1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])

    half = N // 2
    if N % 2 == 0:
        return half - 1
    else:
        return half


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
N = int(input())
ans = N//2
if N % 2 == 0:
    ans -= 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
if n%2:print((n+1)//2-1)
else:print(n//2-1)

Submission status: Accepted

Solution code:
n = int(input())
if n%2==0:
    print(n//2 -1)
else:
    print(n//2)

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
  print((n//2)-1)
else:
  print(n//2)

Submission status: Accepted

Solution code:
N = int(input())
print(N//2-1) if N%2==0 else print(N//2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N = int(input())
    print((N-1)//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = (n-1) // 2
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    if N % 2 == 1:
        print(N//2)
    else:
        print(N//2-1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    a = int(input())
    if a % 2 == 0:
        print(a//2 -1)
    else:
        print(a//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    if n % 2 == 0:
        print(n//2 - 1)
    else:
        print(n//2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
memo = {}
for i in range(1, n):
    if n - i != i and n - i not in memo:
        memo[i] = 1
        memo[n-i] = 1
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    if n%2 == 0:
        print(n//2-1)
    else:
        print(n//2)   
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input()) 
if N%2 ==0:
  print(N//2-1)
else:
  print((N-1)//2)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

N = int(input())

if N%2==0:
	ans = N//2-1
else:
	ans = N//2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

print((n-1) // 2)

Submission status: Accepted

Solution code:
n = int(input())

if n%2 == 0:
    print(int(n/2 - 1))
else:
    print(int((n-1)/2))

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n):
    j = n-i
    if i >= j:
        continue
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n = ri()
if n % 2 == 0:
    print(n // 2 - 1)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1, n):
  if (n-i) != i and (n-i) > i:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()

# int(input())
# map(int, input().split())


def solve():
    import sys
    input = sys.stdin.readline
    n = int(input())
    if n % 2 == 0:
        print(n // 2 - 1)
    else:
        print(n // 2)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())
print((N - 1)//2)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print(int(n/2-1))
else:
    print(n//2)

Submission status: Accepted

Solution code:
N = int(input())
if N %2 == 0:
    print(int(N/2)-1)
else:
    print(int(N/2))

Submission status: Accepted

Solution code:
N = int(input())

print((N+1)//2-1)

Submission status: Accepted

Solution code:
import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations


def li ():
	return list (map (int, sys.stdin.readline ().split ()))


def num ():
	return map (int, sys.stdin.readline ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


def lcm ( x, y ):
	gg = find_gcd (x, y)
	return (x * y // gg)



mm = 1000000007
def solve ():
	t = 1
	for tt in range (t):
		n=nu()
		if(n%2==0):
			print(n//2-1)
		else:
			print(n//2)








if __name__ == "__main__":
	solve ()

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n
# a, b = list(map(int, input().split()))
# s = input()


N = int(input())
ans = (N-1) // 2
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    print((int(input())-1)//2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import heapq
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

def main():
    n = getN()
    ans = 0
    for i in range(1, n//2+1):
        if (n-i) != i and (n-1) > 0:
            ans += 1

    print(ans)

    return

if __name__ == "__main__":
    main()

"""
10
203941992 742164984
670850202 743524472
687298546 744891559
676493045 744182895
385467254 742631752
740505911 744926772
425723256 743348462
225362543 742332848
399450535 742706299
563528474 743419738
"""

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(1,N//2+1):
    if(i!=N-i):
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 1:
    print(int((n-1)/2))
else:
    print(int(n/2 -1))

Submission status: Accepted

Solution code:
n = int(input())

if n % 2 == 0:
    print((n - 1) // 2)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()

  if n%2==0:
    n-=1
  return n//2

# main()
print(main())

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
if N % 2 == 0:
    print(N // 2 - 1)
else:
    print(N // 2)

Submission status: Accepted

Solution code:
import os
import sys

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

N = int(sys.stdin.readline())

s = set()
for i in range(1, N):
    a = N - i
    b = i
    if a == b:
        continue
    s.add((max(a, b), min(a, b)))
a = len(s)
print(a)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
#import math
#import time
import random  # randome is not available at Codeforces
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
#eps=10**(-10)
#ts=time.time()
#sys.setrecursionlimit(10**6)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
#show_flg=True

n=I()
if n%2==0:
    ans=n//2-1
else:
    ans=n//2

#for _ in range():
    

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

print(n//2 - 1 if n % 2 == 0 else n//2)

Submission status: Accepted

Solution code:
n=int(input())
print((n+1)//2-1)

Submission status: Accepted

Solution code:
N = input()
print (N-1)/2

Submission status: Accepted

Solution code:
N = int(input())
r = (N-1)//2
print(r)

Submission status: Accepted

Solution code:
N=int(input())
print(N//2 if N%2 else N//2-1)

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())

if N % 2 == 0:
    print(N // 2 - 1)
else:
    print(N // 2)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
if N % 2 == 0:
    N -= 1
print(N//2)

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 0:
    print((n - 1) // 2)
else:
    print(n//2)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    print((n-1)>>1)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:

t=int(input())
print((t-1)//2)

Submission status: Accepted

Solution code:
N=int(input())
print((N+1)//2-1)

Submission status: Accepted

Solution code:
N = int(input())

print(N // 2 - 1 + N % 2)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    if n%2 == 0:
        n -= 1

    print(n//2)


main()

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, n // 2 + 1):
    if i != n - i:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 0:
    print(N//2-1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re
import heapq


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    n = ii()

    ans = (n-1)//2
    print(ans)

main()

Submission status: Accepted

Solution code:
x = int(input())

print (int((x-1) // 2))

Submission status: Accepted

Solution code:
N =  int(input())

print((N-1)//2)

Submission status: Accepted

Solution code:
n = input()
print n // 2 - (n % 2 == 0)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

answer = N//2 if N&1 else N//2-1
print(answer)

Submission status: Accepted

Solution code:

n = int(input())

print((n-1)//2)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
  print(n//2-1)
else:
  print(n//2)

Submission status: Accepted

Solution code:
n = int(input())

count = 0
for i in range(1, n):
    if i < n-i:
        count += 1

print(count)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque
import re
import math
import functools

def sRaw():
    return input().rstrip("\r")

def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    
def ZAlgo(s):
    l = len(s)
    A = [0]*l
    i =1
    j =0
    A[0]=l
    while i<l:
        while i+j<l and s[j] == s[i+j]:
            j+=1
        if j==0:
            i+=1
            continue
        A[i]=j
        k=1
        while (i+k<l) and (k+A[k]<j):
            A[i+k] =A[k]
            k+=1
        i+=k
        j-=k
    return A


def main():
    N = iRaw()
    ans =0
    if N%2!=0:
        return N//2
    else:
        return (N-1)//2

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

Submission status: Accepted

Solution code:

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
if N%2 == 0:
    print(N//2-1)
else:
    print(N//2)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
n=int(input())
if n%2==0:
    print((n-1)//2)
else:
    print(n//2)

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    if n%2==0:
        print(n//2-1)
    else:
        print((n-1)//2)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    print((n-1)//2)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	if N % 2 == 0:
		print(N // 2 - 1)
	else:
		print(N // 2)


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
N = int(input())

ret = 0
for i in range(1, N + 1) :
    if i < N - i :
        ret += 1
        
print(ret)

Submission status: Accepted

Solution code:
n=int(input())
if n%2==0:
    print((n//2)-1)
else:
    print(n//2)

Submission status: Accepted

Solution code:

N = int(input())

if N % 2 == 0:
    print (N//2 -1)
else:
    print (N // 2)

Submission status: Accepted

Solution code:
n=int(input())
print(n//2-(n+1)%2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from collections import deque, defaultdict
import itertools as ite
import sys
import math
import decimal

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()

if N % 2 == 0:
    print (N - 1) / 2
else:
    print N / 2

Submission status: Accepted

Solution code:
n = int(input())
if n% 2 == 0:
  print(n//2-1)
else:
  print(n//2)

Submission status: Accepted

Solution code:
N = int(input())
print(N//2 - 1 if N % 2 == 0 else N // 2)

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()
co = 0
for i in range((n-1)//2):
    co += 1
print(co)

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
    N-=1
print(N//2)

Submission status: Accepted

Solution code:
N = int(input())
ans = (N-1)//2
print(ans)

Submission status: Accepted

Solution code:
#%%
n = int(input())
ans = (n-1)//2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

print((N - 1) // 2)

Submission status: Accepted

Solution code:
# import sys
# input = sys.stdin.readline

n = int(input())
print((n-1)//2)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    print((n-1)//2)
resolve()

Submission status: Runtime Error

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

d.sort()
mod = 998244353
s = [0 for i in range(max(d)+1)]

for i in range(n):
  s[d[i]] += 1
ans = 1
for i in range(len(s)):
  if s[i] == 0:
    print (0)
    exit()
  if i == 0:
    if s[i] > 1:
      print (0)
      exit()
    continue
  ans *= s[i-1]**(s[i])
  ans %= mod
print (ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

#l = list(map(int, input().split()))
#import numpy as np
#arr = np.array([int(i) for i in input().split()])
'''
a,b=[],[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

n=int(input())
d=list(map(int,input().split()))
if d[0]!=0:
    print(0)
    sys.exit()
import collections
ans=1
d=collections.Counter(d)
d=sorted(d.items())
for i in range(len(d)):
    if d[i][0]==1 or d[i][0]==0:
        continue
    if d[i-1][1]==0:
        print(0)
        sys.exit()
    ans*=d[i-1][1]**d[i][1]
    if ans>998244353:
        ans%=998244353
print(ans)

Submission status: Runtime Error

Solution code:
N = input()
print((N-1)//2)

Submission status: Runtime Error

Solution code:
print((int(input()-1)//2)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
dic = {}
for i in range(N):
    if A[i] in dic:dic[A[i]] += 1
    else:dic[A[i]] = 1
# print(dic)
num = 1
n = 0
if (dic.get(0)==None)|(dic.get(1)==None):num = 0
elif(dic[0]>1):num = 0
else:
    while 1:
        num *= dic[n]**dic[n+1]
        dic.pop(n)
        n += 1
        if not dic.get(n+1):
            dic.pop(n)
            if dic.keys():
                num = 0
            break
print(num%998244353)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
for i in range(1,N/2+1):
  if i != N-i:
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
print(int(input()-1)//2)

Submission status: Runtime Error

Solution code:
import sys
from collections import Counter
 
n = int(input())
arr = list(map(int, input().split()))
 
c = list(Counter(arr).items())
 
c.sort()
 
if c[0][0] != 0 or c[0][1] != 1:
    print(0)
    sys.exit()
 
prev_k = 0
prev_v = 1
ans = 1
mod = 998244353
for k, v in c[1:]:
    if k - prev_k > 1:
        print(0)
        sys.exit()
    else:
        ans *= prev_v**v % mod
        ans %= mod
        prev_k = k
        prev_v = v
 
print(ans)

Submission status: Runtime Error

Solution code:
if n == 1 or n == 0 or n == 2:
  print(0)
elif n <= 4:
  print(1)
else:
  print(n // 2)

Submission status: Runtime Error

Solution code:
print(round(input()/2)-1)

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n;
        n=scan.nextInt();
        System.out.println((n-n%2)/2);
    }
}

Submission status: Runtime Error

Solution code:

# shortest path on line

n, m = map(int, input().split())

graph = {i: {} for i in range(1, n + 1)}

for i in range(1, n):
    graph[i + 1][i] = 0

for _ in range(m):
    l, r, c = map(int, input().split())
    graph[l][r] = c


###############################################################

import heapq

def dijkstra(s, graph, n):
    # ｓからのグラフの最短最短距離をまとめたデータを返す
    dist = [10**20 for i in range(n + 1)]
    dist[s] = 0
    pq = []
    heapq.heapify(pq)
    # 全ての接点を一度優先度付きキューに挿入する
    heapq.heappush(pq, (0, s))
    while pq:
        x = heapq.heappop(pq)
        node, mini_dis = x[1], x[0]
        for point in graph[node].keys():
            w = graph[node][point]
            # nodeからpointに対して伸びる辺の長さ
            newlen = dist[node] + w
            if newlen < dist[point]:
                heapq.heappush(pq, (newlen, point))
                dist[point] = newlen

    return dist
###############################################################


a = dijkstra(1, graph, n)
if a[n]>=10**20:
    print(-1)
else:
    print(a[n])

Submission status: Runtime Error

Solution code:
n = int(input())

print(n - (n+1)%2)//2

Submission status: Runtime Error

Solution code:
N = map(int, input())
answer = N // 2
print(answer)

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 2 == 1:
  print((n-1)//2)
else:
  print(n-2)//2)

Submission status: Runtime Error

Solution code:
import math
print(math.celi(int(input()))-1)

Submission status: Runtime Error

Solution code:
import math
print(math.celi(int(input())-1)

Submission status: Runtime Error

Solution code:
a=int(input())

x=(a-2)/2
if int(x) ==x:
    print(int(x)
else:
    print(int(x)+1)

Submission status: Runtime Error

Solution code:
a=input()
#b=int(input())
#c=int(input())
#d=int(input())
x=(a-2)/2
if int(x) ==x:
    print(int(x))
else:
    print(int(x)+1)