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:
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());
print((N-1)//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:
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 math
n = int(input())
print(math.ceil(n/2)-1)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
def main():
    number = int(input())
    print(number // 2 - (number + 1) % 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import bisect
# from collections import Counter, defaultdict, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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())

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

Submission status: Accepted

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

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 if N%2 else N//2-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

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(int((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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
# <=2, 0
# 3, 1
# 4, 1
# 5, 2
print((N-1)//2)

Submission status: Accepted

Solution code:
i  = int(input())

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

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())
if N % 2 == 1:
    print(int(N / 2))
else :
    print(int(N / 2 - 1))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
print(int(n/2)-1 if n%2==0 else int((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:
from sys import stdin
N = int(stdin.readline().rstrip())
if N % 2 == 0:
    print(N//2-1)
else:
    print((N-1)//2)

Submission status: Accepted

Solution code:
def examA():
    N = I()
    ans = (N-1)//2
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LFI(): return list(map(float,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examA()

"""

"""

Submission status: Accepted

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

n=int(input())

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

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())

ans = 0
d = defaultdict(int)
for i in range(1, n+1):
	d[i]+=1
	j = n-i
	if d[j] > 0: continue
	if j == i: continue
	if j > 0: 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:
a = int(input())

print(a//2-(a%2==0))

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 if n%2==1 else n//2 -1)

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):
    if n % 2 == 0:
        print(int((n / 2) - 1))
    else:
        print(int((n - 1) / 2))


if __name__ == "__main__":
    n = int(input())

    main(n)

Submission status: Accepted

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
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 list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    r = n // 2
    if n % 2 == 0:
        r -= 1

    return r


print(main())

Submission status: Accepted

Solution code:
from sys import stdin
import sys
##  input functions for me
def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##
def main():
    N = ri()
    if N % 2 == 0:
        print(N // 2 - 1)
    else:
        print(N // 2)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    cnt = 0
    for i in range(1, n):
        if i + 1 <= n - i <= n:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    solve()

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(int(n/2) - 1)
elif n % 2 == 1:
	print(n // 2)

Submission status: Accepted

Solution code:
n = int(input())
print(n//2-1 if n%2==0 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())
if N % 2 == 0:
  ans = (N / 2) - 1
else:
  ans = (N - 1) / 2
print(int(ans))

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:
# Tekna 2019 Qualify - A
# -*- encoding: UTF-8 -*-

n = int(input())
s = 0

if n % 2 == 0 :
 s = n / 2 - 1
else :
 s = n // 2

print(int(s))

Submission status: Accepted

Solution code:
n = int(input())
if n % 2 == 1:
  print((n-1)//2)
else:
  print((n-2)//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:
N=int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
S=set()
for i in range(1,N):
    x=i
    y=N-i
    if x<y:
        S.add(x)
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
print(math.ceil(int(input())/2)-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n):
    return (n - 1) // 2
assert solve(4) == 1
assert solve(999999) == 499999

n = int(input())
print(solve(n))

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:
n = int(input())
import sys
if n == 1 or n == 2:
    print(0)
    sys.exit()
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-1)/2))

Submission status: Accepted

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

Submission status: Accepted

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

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(int(n/2)-1)
else:
  print(int(n/2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
print((n-1)//2)

Submission status: Accepted

Solution code:
n=int(input())
from math import factorial
print((n-1)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

else:
    ans = (N - 1) // 2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
  print(n//2-1)
elif n%2 == 1:
  print(n//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:
#Sum of Two Integers
N = int(input())
M = (N-1)//2
if M < 0:
    M = 0
print(M)

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())
count = 0
for i in range(1, N):
    if i != N - i and i < N/2:
        count = count + 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())

ans = N // 2

if N <= 2:
    ans = 0
elif N % 2 == 0:
    ans -= 1

print(ans)

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    cnt = 0
    for i in range(1, n // 2 if n % 2 == 0 else n // 2 + 1):
        if n - i <= n:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    solve()

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 == 1 or N == 2:
    print(0)
else:
    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-1)/2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

if N % 2 == 1:
    ans = (N - 1) / 2

else:
    ans = N / 2 - 1

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-


def main():
    from math import ceil

    n = int(input())
    count = 0

    for i in range(1, ceil(n / 2)):
        j = n - i

        if i != j:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())

N = N / 2 - 1

print(math.ceil(N))    #Nを繰り上げ

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
------------------------
author : iiou16
------------------------
'''


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())
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 == 1:
    print(N // 2)
else:
    print(N // 2 - 1)

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:
print((int(input())-1)>>1)

Submission status: Accepted

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

if __name__=='__main__':
    main()

Submission status: Accepted

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


print(c)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    ans = N-1
    ans = ans // 2
    print(ans)
    
    
if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for a in range(1,N//2 +1):
  b = N - a
  if a == b:
    continue
  else:
    ans += 1
    
print(ans)

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:
x = int(input())
print((x-1)//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:
N=int(input())
num=N
count=0

while num>int(N/2):
    num-=1
    count+=1

print(count-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

if N % 2 == 0 :
    num = N/2 - 1
    print (math.floor(num))
else :
    num = N/2
    print (math.floor(num))

Submission status: Accepted

Solution code:
input_val = input()

val = int(input_val)
val = val - 1
ans = int(val/2)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input().strip())
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())
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:
  print((n//2)-1)
else:
  print(n//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    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:
    print(n//2 -1)
else:
    print(n//2)

Submission status: Accepted

Solution code:
N = int(input())

a = N//2
b = N%2

if b==0:
  a -=1

print(a)

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())
ans = 0
for i in range(1,int((N+1)/2)):
  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:
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 == 0:
  print(int(n/2 - 1))
else:
  print(int((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())
cnt = 0
for i in range(1,N//2 + 1):
    if N - i != i:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
if N%2==0:
    print((N-2)//2)
else:
    print(N//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 if N%2 == 1 else N//2 -1)

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 math

N = int(input())
ans = math.floor(N / 2)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())

print(ceil(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())
if N%2==0:
  print(N//2-1)
else:
  print(N//2)

Submission status: Accepted

Solution code:



            #              ..
            #           .gMMN;
            #           .HMMMR                ....-, .gggggggJJ...
            #     .J,.    TMMN;         ..JgNMMMMMMM{dMMMMMMMMMMMMNNgJ..
            #    .MMMNx.   ?MMb      .JNMMMMMMMMMMMMrJMMMMMMMMMMMMMMMMMNmJ.
            #    ?MMMMMNe.  ?MN,  .iMMMMMMMMMMMMMMMMP(MMMMMMMMMMMMMMMMMMMMMb           .`(zvvvvrOO+.         .(wvO-      _(vvvvvrOz+.   _(ro      _(rl
            #       ?THMMNm. -"!.NMMMMMMMMMMMMMMMMMH%.WHHMMMMMMMMMMMMMMMMMM^           ~ zvC~~~?<?Ovo.       !(rrrI     `_(vO!~~?<1Oro. _(vI      _(rI
            #  .....    ~7W$ ...MMMMMMMMMMMMB0C1????> dZZZZZZZZZWHMMMMMMMB!            ~ zv>     _ Orl      -.vvrrv;     _(vI     _(Ov{ _(rI      _(rI
            #  dMMMMMNNNme .jMMNmTMMMMMMMBC?????????> duZuZuZZuZZZZZXHMMY              ~ zv>     _ zvI      ~jvv<?vw.    _(rI      .zr{ _(rI      _(rI
            #  dMMMMBY"=!`.MMMMMMNmTMMM6????????????z_jZuZZuZuZuZuZZZZC`               ~ zv>    ._JvZ!     _-vI` _jv>    _(vI     _(rr! _(rO-....(-JrI
            #            (MMMMMMMMMD ?1??=?=??=???=?=_(ZZZuZZZZZuZuZV!                 ~ zvw&+xzzwOC!     ._zv:  _.ww_   _(vr&J+xzzrC!  _(rrrrrrvrrrrI
            #          .dMMMMMMMMMD_.- ?1?=?????=???=_(ZZuZZuZuZZZX=`                  ~ zvZ7I1vv>        _(vv&..-(rro   _(rvC777<<`    _(vZ!````~_jrI
            #         .dMMMMMMMMM=.....- ?1??=??????=<(SZZuZZuZZZV!                    ~ zv> _.1rO-      ..wrOOOOOOOrw-  _(vZ           _(vI      _(vI
            #         (MMMMMMMM#!........- <?=???=??=:.SZuZZuZZ0>                      ~ zv>   -?ww-     ~jvv      ~(vO  _(rI           _(rI      _(rI
            #        .MMMMMMMM#!......_(J-.-.<?=?????>.ZZZuZZZC`                       ~ zv>    _(Or+   _.rZ`       -zv{ _(rI           _(vI      _(rI
            #        dMMMMMMMMt.......(TMNm,.-.<=??=?> XZZZZV!                         ~ zv>     _(Or+..~zv>        _(vw._(vI           _(rI      _(rI
            #       .MMMMMMMM#_.........?WMNm,.--<=??z_dZZ0=`                          ~ zw:      _.OO>_.rC`         _jr>_(rC           _(rC      _(rC
            #       (MMMMMMMMD.......-gNNMMMM$...--<?v`dZV~...
            #        dX0vrOz<_``.    -7Y=<~_.......     <gMMMMNNmgJJ...                                                <-. (<
            #       jMMMMMMMNZ???>>+++++(((((----...    dMMMMMMMMMMMMMMNNagJ...                                         (<z!
            #       dMMMMMMMMR??>??>?>??>?>??>?????<    ?MMMMMMMMMMMMMMMMMMMMMMNNm,                                    .+>?1.
            #       JMMMMMMMMK>?????>??>??>?>???<<_(+_ (,?HMMMMMMMMMMMMMMMMMMMMMMMMm.                                  `    `
            #       (MMMMMMMMN+?>>?>??>?>????<<_(;::<_Jyyx?rttrZVVHMMMMMMMMMMMMMMMMMb   ...-.......            ....       ..-.......     ....      ...
            #       .MMMMMMMMNy?>?>?>????<<~_(;::;:;!.Xyyy+(rrtrtrttrrZUWMMMMMMMMMMMM;  _.vrOOOOOwvO+.        ~(rrw_      _jrrOOOOrvO-  - jv>     _ wv:
            #        dMMMMMMMMN+??????<<~-(;;::;;:;< jVyyyWo(trtrrtrtttrtrwMMMMMMMMMM]  _.vZ~    ~_zvI.      ..wrrvl      _jv>    ~?Oro -`jr>     ~ Ov:
            #        .MMMMMMMMMR>??<<_-(;;::;;:;:;;!.XyyyyyWo(OrttrtrrtrttrdMMMMMMMMM\  _.vZ_     ~.vv>     .~jvOOvr-     _jv{     ~(vr_-`jv>     ~ Or:
            #         (MMMMMMMMMC!_-(;;::;:;::;:;;< dVyyyyyyy+(OrrtrtrrtrtrdMMMMMMMMM!  _.vZ_     ~.vr:     _.vI`~(vI.    _jv{     ~-vr!-`jv>     _ wr:
            #          ?MMMMM#5uJ+;;;;:;;:;:;:;::;~.XyyyyyyyyV+(OrtrttrtrrdMMMMMMMMM@   _.vw-  ..-(rr>     ._zv:  -zv:    _jvl   ..(zvC -`jvO((((J+Jrv:
            #           ?YY1(gMMMMN+::;:;:;:;;:;;< dyyyyyyyyyyW+.OrtrrtrwdMMMMMMMMMM\   _.vrrrrrrrZ<`      _(vI   ~(rO.   _jrrrrrrvOC!  -`jrOCCCCOCOrr:
            #             dMMMMMMMMNm+;::;:;::;:;`.VyyyyyyyyyyyWo.OrttrQMMMMMMMMMMMF    _.vO><~jrw_       .-wrrOzzzwrvl   _jvZ!!!~`     -`jv>     ~ Ov:                      .  d=7n   v=7h  .d=7h.
            #             ?MMMMMMMMMMMmx+;:;:;:;< dyyyyyyyyyyyyVy{.zrQNMMMMMMMMMMMF     _.vZ_ -.?rw-      _(vZ<<<<<71ww_  _jv{          -`jv>     ~ Or:          (h (3dIJR.W=!   .(=    .(=  ,$  d{
            #              .TMMMMMMMMMMMMNma+<;<`(yyyyyyyyyyyyyyyV{.dMMMMMMMMMMMMD      _.vZ_   _?wr-    _.rZ`      _jvl  _jv{          -`jv>     ~ Or:           (m$ 4,.,.V .,.(R-... .R-. ..W..f`
            #                (TMMMMMMMMMMMMMMMN;.dkkWWWWWWkQQQNNMMMm(MMMMMMMMMM#^       _.vZ_    _(wv+  ._jv>       __Ov- _jr{          -`jv>     ~ Or:                 `
            #                  .TMMMMMMMMMMMMMM<dMMMMMMMMMMMMMMMMMMMN,HMMMMMM#=         _.vZ_     _.Oro._.rZ`        _(rI._jv{          -`jv>     ~ Ov:
            #                     _THMMMMMMMMMF(MMMMMMMMMMMMMMMMMMMMMN,WMMMD!           _.CC`      ~.7C`~?C!          _7C`_?C!           _?7!     _.?C!
            #                         _?TMMMMM1MMMMMMMMMMMMMMMMMMMMMMMF  `
            #                               `  THMMMMMMMMMMMMMMMB9""!`




import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)

def main():
    n = int(input().strip())
    ans = 0
    for i in range(1, n):
        j = n - i
        if i == j:
            continue
        ans += 1
    print(ans // 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-1)

Submission status: Accepted

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

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())

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

print(result)

Submission status: Accepted

Solution code:
N = int(input())
print(sum(i<N-i for i in range(1,N)))

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 math

n = int(input())
a = math.floor(n / 2)
if(n%2 == 0):
    a=a-1

print(a)

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 :
    print(n//2)
else:
    print(n//2 - 1)

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input().rstrip())
count = 0

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

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 math

N = int(input())


def solve():
    nn = math.ceil(N / 2)
    return nn - 1


print(solve())

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0 :
  print("{}".format(N//2-1))
else:
  print("{}".format(N//2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

if a%2==0:
  print(int((a/2)-1))
elif a%2==1:
  print(int((a-1)/2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#python 3.7.1

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())

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

Submission status: Accepted

Solution code:
print((int(input()) - 1) >> 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
print(a//2-0**(a%2))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

print((N-1)//2)

Submission status: Accepted

Solution code:
# nikkei2019-2-qualA - Sum of Two Integers
def main():
    N = int(input())
    ans = (N - 1) // 2
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print~-input()/2

Submission status: Accepted

Solution code:
print(int(input())-1>>1)

Submission status: Accepted

Solution code:
import math

N = int(input())
print(math.floor((N - 1)/2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

n = int(input())

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

print('{}'.format(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:
n = int(input())
print(int(n / 2) - 1 if n % 2 == 0 else int(n / 2))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
ans = 0
for i in range(1, n // 2 + 1):
    if i == n - i: break
    ans += 1
print(ans)

Submission status: Accepted

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