There were 6 + 5 = <<6+5=11>>11 cookies left before the third friend took 5.
There were 11 + 5 = <<11+5=16>>16 cookies left before the second friend took 5.
There were 16 + 3 = <<16+3=19>>19 cookies left before the first friend took 3.
There were 19 + 1 = <<19+1=20>>20 cookies left before Kristy gave 1 cookie to her brother.
There were 20 + 2 = <<20+2=22>>22 cookies that Kristy baked.
#### 22