count numbers of matching rows and replace its value in another file

Hello all,
can you help me in this problem, assume We have two txt file (file_1 and file_3) one is file_1 contains the data:

a 0
b 1
c 3
a 7
b 4
c 5
b 8
d 6
.
.
.
.
and I need to count the lines with the matching data (a,b,..) and print in new file called file_2 such as the output:

a 2
b 3
c 2
d 1

the other file file_3 contains the data:

a A
b B
c C
d D
.
.
.
now i want two merge the two file to obtain the file format as shown:

A 2
B 3
C 2
D 1

There's no need to use the second file:

awk 'NR==FNR{a[$1]++$2;next} a[$1]{print $2 FS a[$1]}' file1 file3
$ awk 'NR==FNR{a[$1]++$2;next}{print $2,a[$1]}' file1 file3
A 2
B 3
C 2
D 1

Hello,
I try both code but it doesn't work in solaris (give wrong output)

in Solaris, use nawk.