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: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys; readline = sys.stdin.readline
from collections import deque

N = int(readline())
print(N - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
print(a-1)

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
import math
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
#a = list(map(int,input().split()))
#b = list(map(int,input().split()))
s=int(input())
count=0
for i in range(s):
	for k in range(i,s):
		if i+k==s and i!=k:
			count+=1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import itertools

n = int(input())
hint = list(itertools.combinations([i for i in range(1, n+1)], 2))
count = 0

for i in hint:
    if n == sum(i):
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
for x in range(1, n):
  for y in range(x + 1, n):
    if x + y == n:
      count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())



L = []

for i in range(1,N):
  diff = N - i
  pair = sorted([i,diff])
  pair = set(pair)
  if len(pair) == 2 and pair not in L:
    L.append(pair)

print(len(L))

Submission status: Time Limit Exceeded

Solution code:
import sys

n = int(input())
cnt = 0

for i in range(1, int(n / 2)):
    for j in range(1, n):
        if (i + j) == n and i != j:
            cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import itertools
N = int(input())
num =list(range(1,N))
candi = list(itertools.combinations(num,2))

count = 0
for (i,j) in candi:
    if i+j == N:
        count +=1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
li = []
 
for i in range(1, n):
  if n - i == i or i in li:
    continue
    
  else:
    count += 1
    li.append(i)
    li.append(n - i)
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
for i in range(1, (N+1)//2):
    for j in range((N+1)//2, N+1):
        if (i + j) > N:
            break
        elif (i + j) == N:
            ans += 1
            break

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
li = []

for i in range(1, n):
  if n - i == i or [i, n - i] in li or [n - i, i] in li:
    continue
    
  else:
    count += 1
    li.append([i, n - i])
    
print(count)

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
#     print("i",i)
    for j in range(i+1, N+1):
#         print("j",j)
#         print((i + j) == N)
        if (i + j) == N:
            ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ANS = 0
harf = N//2
for i in range(harf):
    for j in range(N-harf,N):
        if i + j == N:
            ANS += 1

print(ANS)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
#a = list(map(int,input().split()))
#b = list(map(int,input().split()))
s=int(input())

a = math.ceil(s/2)
print(a-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, n):
  tmp = n - i
  if i < tmp:
    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())
if n % 2 == 0:
    print(n // 2 - 1)
else:
    print(n // 2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N = int(input())

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())

if N % 2:
  print(N//2)
  exit()
  
print((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:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    
    '''w,h=MI()
    lis=[LI() for i in range(h)]
    step=[[0,-1],[-1,0],[-1,1],[0,-1],[1,0],[0,1]]
    print(lis)
    for i in range(h):
        for j in range(w):
            if lis[i][j]==0:
                count=0
                for x,y in step:
                    if 0<=i+x<h and 0<=j+y<w and lis[i+x][j+y]==1:
                        count+=1
            if count==6:
                lis[i][j]=1
    ans=0
    for i in range(h):
        for j in range(w):
            if lis[i][j]==1:
                for x,y in step:
                    if not (0<=i+x<h and 0<=j+y<w):
                        ans+=1
                    elif lis[i+x][j+y]==0:
                        ans+=1
            print(ans)
    print(ans)
                        
    print(lis)'''
    n=I()
    if n%2==0:
        print(n//2-1)
    else:
        print((n-1)//2)
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    if n == 1 or n == 2:
        ans = 0
    else:
        if n % 2 == 0:
            ans = n // 2 - 1
        else:
            ans = n // 2

    print(ans)


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin())
  print((N-1)//2)
  return 

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#第二回全国統一プログラミング王決定戦予選 a
n=int(input())
ans=0
for i in range(1,(n+1)//2):
    ans+=1
print(ans)

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

Submission status: Accepted

Solution code:
p, q = divmod(int(input()), 2)
print(p - (q ^ 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:
  print(N//2-1)
else:
  print(N//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 998244353

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

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:
import sys

input = sys.stdin.readline


def main():
    N = int(input())

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

    print(ans)


if __name__ == "__main__":
    main()

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(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:
def main():
    N = int(input())

    ans = 0
    for i in range(1, N):
        j = N - i

        if i != j:
            ans += 1

    print(ans//2)
    
if __name__ == "__main__":
    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:
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

def main():
	n=II()

	print((n-1)//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:
# coding: utf-8

N=  int(input())

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
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(N//2-1)
else:
    print(N//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from collections import Counter
# n = int(input())
# li = list(map(int, input().split()))
# a, b = map(int, input().split())

n = int(input())

print(n//2 if n&1 else n//2-1)

Submission status: Accepted

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

Submission status: Accepted

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

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=int(input())
s=set()
for i in range(1,n):
  j=n-i
  if i==j:continue
  t=[i,j]
  t.sort()
  key=str(t[0])+str([1])
  s.add(key)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())

ans = (n-1)//2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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())
N-=1
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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N = INT()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0 - -n//2 - 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())
N -= (1-N%2)
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:
import math;print(int(math.floor(int(input())-.5)/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 == 1:
    print(0)
elif n == 2:
    print(0)
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:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
print((n+1)//2 - 1)

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

N = ii()

print((N-1)//2)

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

N = ii()

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

Submission status: Accepted

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

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    ans=0
    for i in range(1,N):
        j=N-i
        if i!=j:
            ans+=1
    print(ans//2)
        
        

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
ans = []
for i in range(1, N//2+1):
  if i != (N-i):
    ans.append((i, N-i))
print(len(set(ans)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

print(n - n//2 -1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
num = int(input())

# if num % 2 == 0:
#     half = num / 2
# else:
#     half = int(num  + 1) / 2

half = int(num / 2)

count = 0

for i in range(1, half + 1):
    a = i
    b = num - i
#     print(a,b)
    if a != b:
        count += 1
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

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

resolve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())

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

    print(res)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    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())
ans=0
for i in range(1,n+1):
    if i<n-i:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
a = int(input())
if (a % 2 == 0):
    print(a // 2 - 1)
else:
    print((a+1)//2-1)

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)
MOD = 998244353


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//2)

Submission status: Accepted

Solution code:
# 第2回全国統一プログラミング王決定戦予選-A
N=int(input())
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().rstrip()
def main():
    n=int(input())
    print((n-1)//2)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
print((int(input())+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:
print((int(input())-1) // 2)

Submission status: Accepted

Solution code:
# A - Sum of Two Integers
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a,b = divmod(n,2)
if b == 0:
  a -= 1
print(a)

Submission status: Accepted

Solution code:
N=int(input())

M=[]

for i in range (1,N):
    if N-i!=i:
        M.append(N-i)

print(len(M)//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 第二回全国統一プログラミング王決定戦予選: A – Sum of Two Integers
n = int(input())
print((n - 1) // 2)

Submission status: Accepted

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

Submission status: Accepted

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

from math import floor

n = int(readline())
print(floor((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())
iteration = n
ex = 0
count = 0
for i in range(1,n):
    ex = iteration-i
    #print(ex)
    if ex <=i:
        break
    else:
        count += 1
print(count)

Submission status: Accepted

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

N = int(input().split()[0])
ans = (N - 1) // 2
print(ans)

Submission status: Accepted

Solution code:
import math
print(int(math.ceil(int(input())/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())-1
print(N//2)

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = int(input())

    print((a-1)//2)

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:
import math
n=int(input())
print(math.ceil(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:
n = int(input())

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