Valera the Horse is going to the party with friends. He has been following the fashion trends for a while, and he knows that it is very popular to wear all horseshoes of different color. Valera has got four horseshoes left from the last year, but maybe some of them have the same color. In this case he needs to go to the store and buy some few more horseshoes, not to lose face in front of his stylish comrades.

Fortunately, the store sells horseshoes of all colors under the sun and Valera has enough money to buy any four of them. However, in order to save the money, he would like to spend as little money as possible, so you need to help Valera and determine what is the minimum number of horseshoes he needs to buy to wear four horseshoes of different colors to a party.
The first line contains four space-separated integers *s*<sub class="lower-index">1</sub>, *s*<sub class="lower-index">2</sub>, *s*<sub class="lower-index">3</sub>, *s*<sub class="lower-index">4</sub> (1 ≤ *s*<sub class="lower-index">1</sub>, *s*<sub class="lower-index">2</sub>, *s*<sub class="lower-index">3</sub>, *s*<sub class="lower-index">4</sub> ≤ 10<sup class="upper-index">9</sup>) — the colors of horseshoes Valera has.

Consider all possible colors indexed with integers.
# def width_cal():
#     person_n_height = list(map(int,input().strip().split()))[:2]
#     n_person = person_n_height[0]
#     height = person_n_height[1]
#     list_of_heights = list(map(int,input().strip().split()))[:n_person]
#     width = 0
#     for person in range(len(list_of_heights)):
#         if list_of_heights[person]>height:
#             width+=2
#         else:
#             width+=1
#     return width
# print(width_cal())

# def winer():
#     num_round = int(input())
#     winner_list = list(input().upper())
#     count_A = 0
#     count_D = 0
#     for name in winner_list:
#         if name=='A':
#             count_A +=1
#         if name =='D':
#             count_D +=1
#     winner = 'Friendship'
#     if count_A>count_D:
#         winner = 'Anton'
#         return winner
#     if count_A < count_D:
#         winner = 'Danik'
#         return winner
#     return winner
# print(winer())

#3
# def bear_bigbrother():
#     wt_list = list(map(int,input().strip().split()))
#     limak_wt = wt_list[0]
#     bob_wt = wt_list[1]
#     num_year = 0
#     while limak_wt<=bob_wt:
#         limak_wt *=3
#         bob_wt *= 2
#         num_year+=1
#         if limak_wt>bob_wt:
#             return num_year
# print(bear_bigbrother())

#4
# def a_team():
#     num_problem = int(input())
#     # confdnce_list = []
#     n_confidence = 0
#     for i in range(num_problem):
#         known_list = list(map(int,input().strip().split()))[:3]
#         sum_known = sum(known_list)
#         if sum_known>1:
#             n_confidence+=1
#     return n_confidence 
# print(a_team())

#5
# def beautiful_matrix():
#     beautiful_index = [2,2]
#     index_of_1 = []
#     for i in range(5):
#         input_list = list(map(int,input().strip().split()))[:5]
#         if 1 in input_list:
#             index = input_list.index(1)
#             index_of_1.extend([i,index])
#     minimum_step = abs(index_of_1[0]-beautiful_index[0])+abs(index_of_1[1]-beautiful_index[1])
#     return minimum_step
# print(beautiful_matrix())

#6
# def gravity_flip():
#     n_col = int(input())
#     list_of_element = list(map(int,input().split()))[:n_col]
#     reverse_list = sorted(list_of_element,reverse=False)
#     reverse_list_1 = " ".join(map(str,reverse_list))
#     return (reverse_list_1)
# print(gravity_flip())

#7
# def petya_strings():
#     eng_letters = [chr(ord('a')+i) for i in range(26)]
#     string_a = input().lower()
#     # string_a = sorted(string_a)
#     string_b = input().lower()
#     # string_b = sorted(string_b)
#     if len(string_a)!=len(string_b):
#         return None
#     for i in range(len(string_a)):
#         let_a = string_a[i]
#         let_b = string_b[i]
#         index_a = eng_letters.index(let_a)
#         index_b = eng_letters.index(let_b)
#         if index_a > index_b:
#             return 1
#         if index_a < index_b:
#             return -1
#     return 0
# print(petya_strings())

#8
# def boy_or_girl():
#     user_name = input()
#     if len(user_name)>100:
#         return None
#     unique_name = [*set(user_name)]
#     if len(unique_name)%2==0:
#         return 'CHAT WITH HER!'
#     return 'IGNORE HIM!'

# print(boy_or_girl())

#9
# def Aword():
#     input_word = input()
#     upper_letter = [chr(ord('A')+i) for i in range(26)]
#     # lower_letter = [chr(ord('a')+i) for i in range(26)]
#     upper_count = 0
#     lower_count = 0
#     for letter in input_word:
#         if letter in upper_letter:
#             upper_count+=1
#         else:
#             lower_count+=1
#     if upper_count>lower_count:
#         input_word = input_word.upper()
#         return input_word
#     if upper_count<lower_count:
#         input_word = input_word.lower()
#         return input_word
#     return input_word.lower()
# print(Aword())

#10
# def Magnet():
#     num_magnet = int(input())
#     group = 1
#     first_magnet = input()
#     for i in range(1,num_magnet):
#         next_magnet = input()
#         if first_magnet!=next_magnet:
#             group+=1
#             first_magnet=next_magnet
#     return group
# print(Magnet())

#11
# def sereja_dima():
#     num_card = int(input())
#     list_of_card_numb = list(map(int,input().split(' ')))[:num_card]
#     sreja = []
#     dima = []
#     while len(list_of_card_numb)>0:
#         max_sereja = max(list_of_card_numb[0],list_of_card_numb[-1])
#         sreja.append(max_sereja)
#         list_of_card_numb.remove(max_sereja)
#         # list_of_card_numb = new_list
#         if len(list_of_card_numb)>0:
#             max_dima = max(list_of_card_numb[0],list_of_card_numb[-1])
#             dima.append(max_dima)
#             list_of_card_numb.remove(max_dima)
#             # list_of_card_numb = new_list
#         if len(list_of_card_numb)==0:
#             break
#     sum_sereja = str(sum(sreja))
#     sum_dima = str(sum(dima))
#     return_list = [sum_sereja,sum_dima]
#     return ' '.join(return_list)
# print(sereja_dima())

#12
# def stones_on_the_table():
#     num_stone = int(input())
#     color_name = input()
#     color_list = [i for i in color_name][:num_stone]
#     first_index = 0
#     global_count = 0
#     def get_count(list_ele,first):
#         count=0
#         while (first< (len(list_ele)-1)) and (len(list_ele)>1) :
#             if list_ele[first] == list_ele[first+1]:
#                 list_ele.remove(list_ele[first+1])
#                 count +=1
#             else:
#                 break
#         return list_ele,int(count)
    
#     while first_index < (len(color_list)-1):
#         modified_list,count_mod = get_count(color_list,first_index)
#         color_list = modified_list
#         global_count += count_mod
#         first_index +=1
#     return global_count
# print(stones_on_the_table())

#13
# def Police_Recruits():
#     num_event = int(input())
#     list_event = list(map(int,input().split()))[:num_event]
#     crime_count = -1
#     police_recruit = 0
#     unsolved_crime = 0
#     for i in range(num_event):
#         if list_event[i] ==-1:
#             # crime_count+=1
#             solved = police_recruit+crime_count
#             if (solved)<=(-1):
#                 unsolved_crime +=1
#             else:
#                 police_recruit = solved
            
#         else:
#             police_recruit+=list_event[i]
#     return unsolved_crime
# print(Police_Recruits())

#14
# def Black_Square():
#     calory_list = list(map(int,input().split()))[:4]
#     index_of_strip = input()
#     total_calory = 0
#     for i in index_of_strip:
#         if int(i) <= len(calory_list):
#             total_calory += calory_list[int(i)-1]

#     return total_calory
# print(Black_Square())

#15
# def Night_at_the_Museum():
#     input_name = input().lower()[:100]
#     lower_letter = [chr(ord('a')+i) for i in range(26)]
#     move_distance = 0
#     prev_pos = 1

#     for letter in input_name:
#         indx_letter = (lower_letter.index(letter))+1
#         if indx_letter>=prev_pos:
#             dist = min((indx_letter-prev_pos),(len(lower_letter)-indx_letter+prev_pos))
#             prev_pos = indx_letter
#             move_distance +=dist
#         if indx_letter<prev_pos:
#             dist = min((prev_pos-indx_letter),(len(lower_letter)+indx_letter-prev_pos))
#             prev_pos = indx_letter
#             move_distance +=dist
#     return move_distance

# print(Night_at_the_Museum())

#16
# def A_games():
#     num_teams = int(input())
#     num_teams = num_teams if 2<=num_teams<=30 else None
#     drescode_list = []
#     total_guest_jearsy = 0
#     for i in range(num_teams):
#         dress_codes = tuple(list(map(int,input().split()))[:2])
#         drescode_list.append(dress_codes)
#     for i in range(len(drescode_list)):
#         for j in range(i+1,len(drescode_list)):
#             t1_home = drescode_list[i][0],drescode_list[j][1]
#             if t1_home[0]==t1_home[1]:
#                 total_guest_jearsy+=1
#             t2_home = drescode_list[i][1],drescode_list[j][0]
#             if t2_home[0]==t2_home[1]:
#                 total_guest_jearsy+=1
#     # drescode_and_away_jearsey = []
#     # drescode_and_away_jearsey.append(drescode_list)
#     # drescode_and_away_jearsey.append(total_guest_jearsy)
#     # return drescode_and_away_jearsey
#     return total_guest_jearsy   
# print(A_games())

#17
# def buy_a_Shovel():
#     input_list = list(map(int,input().split()))[:2]
#     shovel_price = input_list[0] if 1<=input_list[0]<=1000 else None
#     lower_denom = input_list[1] if 1<=input_list[1]<=9 else None
#     num_shovel = 0
#     i = True
#     j = 1
#     while i :
#         if (((shovel_price*j)-lower_denom)%10 == 0) or ((shovel_price*j)%10==0) :
#             num_shovel = j
#             i = False
            
#         else:
#             j +=1
#             i = True
#     return num_shovel
# print(buy_a_Shovel())

#18
def horse_shoe():
    shoe_avail = list(map(int,input().split()))[:4]
    # shoe_avail = shoe_avail if 1<=len(shoe_avail)<10**9 else None
    unique_col = len(set(shoe_avail))
    required_num_col = len(shoe_avail)-unique_col
    return required_num_col

print(horse_shoe())

