+if [ $# = 3 ]; then
+
+echo "Calculation of formation energy (Method 2, two species)"
+
+e3=`./e_coh $3 | grep cohesive | grep and | awk '{ print $6 }'`
+sicnt=`./e_coh $3 | grep ^\ \ Si: | awk '{ print $2 }' | sed 's/,//'`
+ccnt=`./e_coh $3 | grep ^\ \ Si: | awk '{ print $4 }' | sed 's/,//'`
+et=`echo $e3 $sicnt $ccnt | awk '{ print $1*($2+$3) }'`
+echo " Interstitial configuration: `basename $3` -> $et"
+e1=`./e_coh $1 | grep cohesive | grep and | awk '{ print $6 }'`
+e2=`./e_coh $2 | grep cohesive | grep only | awk '{ print $5 }'`
+echo " Cohesive energies:"
+echo " `basename $1` -> $e1 ($sicnt)"
+echo " `basename $2` -> $e2 ($ccnt)"
+
+((count = sicnt + ccnt))
+
+echo "$et $sicnt $e1 $ccnt $e2" | \
+ awk '{ print " formation energy M2: "$1-$2*$3-$4*$5 " eV" }'