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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

sup = int(N // 2) + 1

L = []

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


    
print(len(L))

Submission status: Accepted

Solution code:
import os
import numpy as np

class getStdin(object):
    @classmethod
    def get_int(cls):
        return int(input())

    @classmethod
    def get_ss_int(cls):
        return list(map(int, input().split()))

    @classmethod
    def get_na_int(cls):
        return np.array(sorted(list(map(int, input().split()))))

    @classmethod
    def get_na_intr(cls):
        return np.array(sorted(list(map(int, input().split())))[::-1])

if __name__ == '__main__':
    n = getStdin.get_int()
    if n % 2 == 0:
        print(n//2 -1)
    else:
        print(n//2)
    os.sys.exit(0)

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
t = n // 2
print(n - t - 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

n=int(n/2+0.5-1)
print(n)

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  ans = 0
  for i in range(1,1+n//2):
    j = n-i
    if j > i:
      ans += 1
  print(ans)
solve()

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:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int):

    print((N-1)//2)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
if a % 2 is 0:
  print(a // 2 - 1)
else:
  print(a // 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())
if n==1:
  print(0)
for i in range(1,n):
  if n-i<=i:
    print(i-1)
    break

Submission status: Accepted

Solution code:
a = int(input())

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

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

Submission status: Accepted

Solution code:

import math

if __name__ == "__main__":
    N = int(input())
    if N % 2 == 0:
        hoge = N / 2
        print(math.floor(hoge) - 1)
    else:
        print(math.floor(N / 2))

Submission status: Accepted

Solution code:
def solve(n):
    if n % 2 == 0:
        return n // 2 - 1
    else:
        return (n - 1) // 2


def main():
    n = int(input())
    res = solve(n)
    print(res)


def test():
    assert solve(4) == 1
    assert solve(999999) == 499999


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

Submission status: Accepted

Solution code:
N = int(input())
a = []
 
for x in range(1, N):
    y = N-x
    if x == y:
        continue
    if x > y:
        break
    a.append([x, y])
 
print(len(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input().split()
[N] = s
N = int(N)

print ((N-1)/2)

Submission status: Accepted

Solution code:
def solution(N):
    ans = 0
    for i in range(N-1, int(N/2), -1):
        j = N-i
        ans+=1
    return ans

test_input = input()
test_input = int(test_input)
print(solution(test_input))

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

Submission status: Accepted

Solution code:
N = int(input())
if N % 2 == 0 :
    Ans = int(N/2-1)
else :
    Ans = int((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())
ans = set()
for i in range(1, N + 1):
    j = N - i
    if i == j or i == 0 or j == 0:
        continue
    ans.add((min(i, j), max(i, j)))
print(len(ans))

Submission status: Accepted

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

    print(round(((n-2)/2)))


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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

import math
#import numpy as np
#import operator
#import bisect
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

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

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



	

if __name__ == '__main__':
	main()

Submission status: Accepted

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

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:
from sys import stdin
a= int(stdin.readline().rstrip())
if a % 2 ==0:
    print(a//2-1)
else:
    print(a//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
N1 = input()
N = int(N1)
i = 0
j = 1
r = 0
a = 0
for j in range (N):
    i=N-j
    if i!=j : 
        r+=1
        
a = math.floor (r/2)
print(a)

Submission status: Accepted

Solution code:
N=int(input())

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

else :
    print(round((N-1)/2))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

import pdb
import sys
F = sys.stdin
N = int(F.readline())
count = 0

A = N // 2

for i in range(1, A+1):
    if i*2 != N:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

if N < 3:
  print(0)
elif N % 2 == 0:
  print(N//2 - 1)
elif N % 2 != 0:
  print((N+1)//2 - 1 )

Submission status: Accepted

Solution code:
def main():                                                                     
  n = int(raw_input())                                                          
  data = {}                                                                     
                                                                                
  for a in xrange(1,n):                                                         
      b = n-a                                                                   
      if a == b:                                                                
          continue                                                              
      data[(min(a,b), max(a, b))] = 1                                           
                                                                                
  print(len(data.keys()))                                                       
                                                                                
main()

Submission status: Accepted

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

def main():
  inline = [input() for i in range(1)]
  outline = 0

  try:
    wk_inline = int(inline[0])
  except Exception as e:
    print('整数値を入力してください')
    return 0

  if wk_inline % 2 == 0:
      outline = wk_inline //2 -1
  else:
      outline = wk_inline // 2

  print(outline)
  return 0

main()

Submission status: Accepted

Solution code:
i = int(input())

print((i-1)//2)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:


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


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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

a-=1
cnt = 0
for i in range(1,a):
	if i < a:
		a -= 1
		cnt += 1
	else :
		break

print (cnt)

Submission status: Accepted

Solution code:
num = int(input())
numList = list(range(0, num))
listLength = len(numList)
counter = 0

#print(numList)

m = [0] * 10000000

for i in range(0, listLength):
    m[numList[i]]
    m[numList[i]] += 1

secondCount = 0

for i in range(0, listLength):
    secondCount += m[num - numList[i]]
    if (num - numList[i] == numList[i]):
        secondCount -= 1

print(int(secondCount / 2))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

if N % 2 == 1:
    N += 1

print(N // 2 - 1)

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:
n=int(input())

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

Submission status: Accepted

Solution code:
from math import floor

N = int(input())

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

Submission status: Accepted

Solution code:
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())
count = 0

if n % 2 != 0:
  n += 1
 
for i in range(1, n // 2):
  if n - i == i:
    continue
    
  else:
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
N = int(input())

ans = int(len(range(1,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-1)/2))

Submission status: Accepted

Solution code:
# 2つの相異なる正整数でNを何通りで表すことができるか
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 // 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n%2 == 0:
  ans = int(n/2 - 1)
else:
  ans = int((n-1)/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:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


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

Submission status: Accepted

Solution code:
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res



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

    
    

        
        
        
            

    
   


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

n=int(input())

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())

count=-1
for i in range(N//2+1):
    count+=1

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

Submission status: Accepted

Solution code:
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

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


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

# %%
# from atcoder_test import doTest
# doTest("nikkei2019-2-qual","a",main)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-09 21:20:16(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   
# import scipy.misc      
# import numpy as np 

def main():
    n = int(sys.stdin.readline().rstrip())
    if n % 2 == 0:
        ans = n // 2 - 1
    else:
        ans = n // 2
    print(ans)


if __name__ == "__main__":
    # execute only if run as a script
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

# print(n)

count = 0
div, mod = divmod(n, 2)
for i in range(1, n // 2 + 1):
    a = i
    b = n - a
    
    if a == b:
        continue

    # print("{}, {}".format(a, b))
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
s=int(input())

cnt=0
if s%2==0:
    cnt=s//2-1
elif s%2!=0:
    cnt=s//2
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
target_list = []
if N % 2 == 1:
    N += 1
for i in range(1, int(N/2)):
    target = N - i
    if target == i:
        continue
    else:
        target_list.append(target)

print(len(target_list))

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

Submission status: Accepted

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

else:
    b = N / 2 - 1
    print(int(b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

print(output)

Submission status: Accepted

Solution code:
from math import ceil, floor
N = int(input())
half = floor(N / 2)
count = 0
for i in range(half):
  count = count + 1
if N % 2 != 0:
  print(count)
else:
  print(count - 1)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
max_n = int(n/2) if n%2 ==0 else int((n+1)/2)
for i in range(1, max_n):
    count+=1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
r, mod = divmod(N, 2)
print(r - 1 + mod)

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for up_from_0 in range(1,N):
  down_from_N = N-up_from_0
  if up_from_0 < down_from_N :
    count += 1
print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 998244353
inf = float('INF')

#A
def A():
    n = II()
    n -= 1
    print(n // 2)
    return

#B
def combination_mod(n, k, mod=mod):
    """ power_funcを用いて(nCk) mod p を求める """ 
    """ nCk = n!/((n-k)!k!)を使用 """

    from math import factorial
    if n < 0 or k < 0 or n < k: return 0
    if n == 0 or k == 0: return 1
    a = factorial(n) % mod
    b = factorial(k) % mod
    c = factorial(n - k) % mod
    return (a * pow(b, mod - 2, mod) * pow(c, mod - 2, mod)) % mod
    

def B():
    n = II()
    d = LI()
    dic = defaultdict(int)
    if d[0] != 0 or 0 in d[1:]:
        print(0)
        return
    for di in d[1:]:
        dic[di] += 1
    ans = 1
    di = list(dic.items())
    di.sort()
    be = 1
    for _, b in di:
        ans *= pow(be, b, mod)
        be = b
    print(ans)
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#input
N = int(input())

count=0
for i in range(1,int(N/2)+1):
#  print(i)
  #if(N-i == 0):
  count += 1

if(N%2 == 0):
  count -= 1

#output
print(count)

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
#入力
n = int(input())

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

print(int(ans))

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = int(lines[0])

    return (n, )

def solve(n):

    if n <= 2:
        return 0
    
    k = (n - 1 ) // 2  
    

    return int(k)
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline

def main():
    n=int(input())
    ans=0
    for i in range(1,n):
        if (i!=n-i and i<n-i):
            ans+=1
        elif i>n-1:
            break
    print(ans)
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
n = int(input())

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


print(int(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:
import math
import numpy as np

N = int(input())

N_half = math.floor(N/2)

counts = 0
for i in np.arange(1, N):
    j = N-i
    if(i != j ):
        counts += 1
        
print(int(counts/2))

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
print((int(input())-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())
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:
  ans = n / 2 - 1
else:
  ans = n / 2
  
print(int(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())
if n % 2 == 1:
    print(int((n - 1) / 2))
else:
    print(int(n / 2 - 1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

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

N = I()

ans = 0
for i in range(1,N):
    if i!=N-i and i<=N//2:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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