Shell command: get memory usage of specific process

Here’s the command, I want to get the average memory usage of one process which pid is 13853. The result is sampled 20 times in one minutes.

ALL=0;
for i in `seq 1 20`; 
do 
  MEM=`pmap 13853|grep total|awk '{print $2}'`;
  ALL=`expr $ALL + ${MEM%%K}`; 
  sleep 3; 
done; 
expr $ALL / 20

The result of pmap is same with VmSize in /proc/status.